@thulite/images 3.3.1 → 3.3.3
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.
- package/CHANGELOG.md +14 -0
- package/assets/scss/components/_images.scss +4 -0
- package/layouts/{_default/_markup → _markup}/render-image.html +16 -3
- package/layouts/{partials → _partials}/figure.html +2 -2
- package/layouts/{partials → _partials}/img.html +2 -2
- package/package.json +1 -1
- /package/layouts/{partials → _partials}/picture.html +0 -0
- /package/layouts/{shortcodes → _shortcodes}/figure.html +0 -0
- /package/layouts/{shortcodes → _shortcodes}/img.html +0 -0
- /package/layouts/{shortcodes → _shortcodes}/picture.html +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @thulite/images
|
|
2
2
|
|
|
3
|
+
## 3.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#36](https://github.com/thuliteio/images/pull/36) [`938b5e6`](https://github.com/thuliteio/images/commit/938b5e660ae27c749d16d5dae289bb64c2d73599) Thanks [@danielfdickinson](https://github.com/danielfdickinson)! - Rebase fix svg images in markdown
|
|
8
|
+
|
|
9
|
+
## 3.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#35](https://github.com/thuliteio/images/pull/35) [`1bd95c8`](https://github.com/thuliteio/images/commit/1bd95c8873fc6ccad4899a0f9361dbbf11120ed9) Thanks [@h-enk](https://github.com/h-enk)! - Update for new template system in Hugo v0.146.0
|
|
14
|
+
|
|
15
|
+
- [#32](https://github.com/thuliteio/images/pull/32) [`c1a4f79`](https://github.com/thuliteio/images/commit/c1a4f79994237373ee91b0c109ed7ad7e6306908) Thanks [@danielfdickinson](https://github.com/danielfdickinson)! - Fix invalid HTML on img tag for render hook
|
|
16
|
+
|
|
3
17
|
## 3.3.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -152,10 +152,11 @@ partial template, after the render hook has captured the resource.
|
|
|
152
152
|
{{- end }}
|
|
153
153
|
|
|
154
154
|
{{/* Convert to webp. */}}
|
|
155
|
-
{{- if
|
|
155
|
+
{{- if not (in (slice "gif" "svg") $r.MediaType.SubType) }}
|
|
156
156
|
{{- $r = $r.Resize (printf "%dx%d webp" $r.Width $r.Height) }}
|
|
157
157
|
{{- end }}
|
|
158
158
|
|
|
159
|
+
{{- if ne $r.MediaType.SubType "svg" }}
|
|
159
160
|
{{- /* Render image element. */ -}}
|
|
160
161
|
<img
|
|
161
162
|
src="{{ $r.RelPermalink }}"
|
|
@@ -165,8 +166,20 @@ partial template, after the render hook has captured the resource.
|
|
|
165
166
|
fetchpriority="{{ site.Params.thulite_images.defaults.fetchpriority }}"
|
|
166
167
|
loading="{{ site.Params.thulite_images.defaults.loading }}"
|
|
167
168
|
alt="{{ .PlainText }}"
|
|
168
|
-
{{- with .Title -}}title="{{ . }}"{{- end
|
|
169
|
+
{{- with .Title -}}title="{{ . }}"{{- end }}
|
|
169
170
|
id="{{ $id }}"
|
|
170
|
-
|
|
171
|
+
>
|
|
172
|
+
{{- else }}
|
|
173
|
+
<img
|
|
174
|
+
src="{{ $r.RelPermalink }}"
|
|
175
|
+
decoding="{{ site.Params.thulite_images.defaults.decoding }}"
|
|
176
|
+
fetchpriority="{{ site.Params.thulite_images.defaults.fetchpriority }}"
|
|
177
|
+
loading="{{ site.Params.thulite_images.defaults.loading }}"
|
|
178
|
+
alt="{{ .PlainText }}"
|
|
179
|
+
{{- with .Title -}}title="{{ . }}"{{- end }}
|
|
180
|
+
id="{{ $id }}"
|
|
181
|
+
class="markdown-svg"
|
|
182
|
+
>
|
|
183
|
+
{{- end }}
|
|
171
184
|
|
|
172
185
|
{{- /**/ -}}
|
|
@@ -59,7 +59,7 @@ Add this CSS to your site to remove small gaps between adjacent elements:
|
|
|
59
59
|
|
|
60
60
|
@context {page} [page] The current page.
|
|
61
61
|
@context {string} [src] The path to the base image: a page resource, a global resource, or a remote resource.
|
|
62
|
-
@
|
|
62
|
+
@context {int} [width] The display width of the image, in pixels, falling back to 100% of the viewport width.
|
|
63
63
|
@context {string} [sizes] = "" # "100vw", "75vw", or "auto" for example
|
|
64
64
|
@context {string slice} [formats] A slice of image formats, ordered by precedence, to use when creating images for the srcset attribute of each source element.
|
|
65
65
|
@context {string} [process] = "" # "fill 1600x900" for example
|
|
@@ -192,7 +192,7 @@ Add this CSS to your site to remove small gaps between adjacent elements:
|
|
|
192
192
|
{{- end }}
|
|
193
193
|
{{- end }}
|
|
194
194
|
{{- else }}
|
|
195
|
-
{{- /* The width was not
|
|
195
|
+
{{- /* The width was not specified, will be using $stdWidths. */}}
|
|
196
196
|
{{- $stdWidths = $stdWidths | append $r.Width | sort }}
|
|
197
197
|
{{- range $stdWidths }}
|
|
198
198
|
{{- /* Do not enlarge. */}}
|
|
@@ -59,7 +59,7 @@ Add this CSS to your site to remove small gaps between adjacent elements:
|
|
|
59
59
|
|
|
60
60
|
@context {page} [page] The current page.
|
|
61
61
|
@context {string} [src] The path to the base image: a page resource, a global resource, or a remote resource.
|
|
62
|
-
@
|
|
62
|
+
@context {int} [width] The display width of the image, in pixels, falling back to 100% of the viewport width.
|
|
63
63
|
@context {string} [sizes] = "" # "100vw", "75vw", or "auto" for example
|
|
64
64
|
@context {string slice} [formats] A slice of image formats, ordered by precedence, to use when creating images for the srcset attribute of each source element.
|
|
65
65
|
@context {string} [process] = "" # "fill 1600x900" for example
|
|
@@ -189,7 +189,7 @@ Add this CSS to your site to remove small gaps between adjacent elements:
|
|
|
189
189
|
{{- end }}
|
|
190
190
|
{{- end }}
|
|
191
191
|
{{- else }}
|
|
192
|
-
{{- /* The width was not
|
|
192
|
+
{{- /* The width was not specified, will be using $stdWidths. */}}
|
|
193
193
|
{{- $stdWidths = $stdWidths | append $r.Width | sort }}
|
|
194
194
|
{{- range $stdWidths }}
|
|
195
195
|
{{- /* Do not enlarge. */}}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|