kamifusen 1.10 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +7 -0
- data/app/views/kamifusen/_view.html.erb +6 -7
- data/lib/kamifusen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623f43a95efe95c7f4966df6584d2e92abfa8b870b94e018e0a97a06221cf110
|
4
|
+
data.tar.gz: e9d1711c003fde435452257b1b43b239f5604606d65c86ba66d1408cae8cfd6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68d9c2bb398bd911934c2b77b3f08f576045d518b4ab30d01cedac10762c05d2382aa680ee6c3365b7eddeb523329779ffd3e1679d09aa5b10c47462cc51f30
|
7
|
+
data.tar.gz: 1499e4a4e86300c822a8c812c1e52c80c4b61851aa5bbafb8e04965276afe2923d2f689ffeef617770e9bed8dc7934d55220d2adfb48bd3139a4f71e816dfdd1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -32,6 +32,13 @@ If you want to disable webp, in config/initializers/kamifusen.rb:
|
|
32
32
|
Kamifusen.with_webp = false
|
33
33
|
```
|
34
34
|
|
35
|
+
If you render kamifusen tags inside a sanitized text, please make sure you allow these tags and attributes in `config/application.yml`:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
config.action_view.sanitized_allowed_tags = ['picture', 'source', 'img']
|
39
|
+
config.action_view.sanitized_allowed_attributes = ['src', 'type', 'srcset', 'width', 'height', 'alt', 'sizes', 'loading', 'decoding']
|
40
|
+
```
|
41
|
+
|
35
42
|
## Usage
|
36
43
|
|
37
44
|
Simply use `kamifusen_tag` instead of `image_tag` in your rails views.## What's the problem?
|
@@ -85,14 +85,13 @@ end
|
|
85
85
|
<picture<%= " class=\"#{picture_class}\"".html_safe unless picture_class.blank? %>>
|
86
86
|
<% if Kamifusen.with_webp %>
|
87
87
|
<source srcset="<%= srcset_webp %>"
|
88
|
-
|
89
|
-
|
88
|
+
<%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
|
89
|
+
type="image/webp">
|
90
90
|
<% end %>
|
91
|
-
<
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<%= raw parameters %>>
|
91
|
+
<source srcset="<%= srcset_default %>"
|
92
|
+
<%= " sizes=\"#{sizes.map { |key, value| [key, value].join(' ') }.join(', ')}\"".html_safe unless sizes.empty? %>
|
93
|
+
type="<%= source.content_type %>">
|
94
|
+
<img src="<%= default %>" <%= raw parameters %>>
|
96
95
|
</picture>
|
97
96
|
<% else %>
|
98
97
|
<picture>
|
data/lib/kamifusen/version.rb
CHANGED