mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-08 02:24:20 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5f4192a639 | ||
![]() |
220cd05f6d | ||
![]() |
3cfc732dff | ||
![]() |
f04b37e0d3 | ||
![]() |
05274cef64 |
@@ -187,7 +187,7 @@ Use the `image` shortcode to display a responsive image with a specific aspect r
|
|||||||
| Argument | Required | Description |
|
| Argument | Required | Description |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| src | Yes | Required url of the image, e.g. "img/boots.jpg" or "https://picsum.photos/id/27/3264/1836". |
|
| src | Yes | Required url of the image, e.g. "img/boots.jpg" or "https://picsum.photos/id/27/3264/1836". |
|
||||||
| ratio | No | Optional aspect ratio of the image, either "1x1", "4x3", "16x9", or "21x9". It not specified the original aspect ratio of the image is preserved. |
|
| ratio | No | Optional aspect ratio of the image, either "1x1", "4x3", "16x9", or "21x9". If set, the image is resized and cropped to match the ratio. Else the original aspect ratio of the image is kept. |
|
||||||
| class | No | Optional class attribute of the inner `img` element, e.g. "rounded". |
|
| class | No | Optional class attribute of the inner `img` element, e.g. "rounded". |
|
||||||
| title | No | Optional alternate text of the image. |
|
| title | No | Optional alternate text of the image. |
|
||||||
| caption | No | Optional figure caption. |
|
| caption | No | Optional figure caption. |
|
||||||
|
@@ -188,7 +188,7 @@ Gebruik de `image` shortcode om een adaptief plaatje met een specifieke verhoudi
|
|||||||
| Parameter | Verplicht | Toelichting |
|
| Parameter | Verplicht | Toelichting |
|
||||||
|-----------|----------|-------------|
|
|-----------|----------|-------------|
|
||||||
| src | Ja | Verplichte url van het plaatje, bijvoorbeeld "img/boots.jpg" of "https://picsum.photos/id/27/3264/1836". |
|
| src | Ja | Verplichte url van het plaatje, bijvoorbeeld "img/boots.jpg" of "https://picsum.photos/id/27/3264/1836". |
|
||||||
| ratio | Nee | Verhouding van het plaatje, de mogelijke waarden zijn "1x1", "4x3", "16x9", en "21x9". Als de verhouding niet is opgegeven dan wordt de verhouding van het originele bestand gebruikt. |
|
| ratio | Nee | Verhouding van het plaatje, de mogelijke waarden zijn "1x1", "4x3", "16x9", en "21x9". Indien opgegeven wordt het plaatje bijgesneden en verkleind om te voldoen aan de ratio. Als de verhouding niet is opgegeven dan wordt de verhouding van het originele bestand gebruikt. |
|
||||||
| class | Nee | Optionele `class` waarde van het `img` element, bijvoorbeeld "rounded". |
|
| class | Nee | Optionele `class` waarde van het `img` element, bijvoorbeeld "rounded". |
|
||||||
| title | Nee | Optionele beschrijving van het plaatje. |
|
| title | Nee | Optionele beschrijving van het plaatje. |
|
||||||
| caption | Nee | Optioneel onderschrift van het plaatje. |
|
| caption | Nee | Optioneel onderschrift van het plaatje. |
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
wrapped in a figure if a caption is provided, else the image is wrapped in a div with a ratio constraint. The
|
wrapped in a figure if a caption is provided, else the image is wrapped in a div with a ratio constraint. The
|
||||||
partial supports the following arguments:
|
partial supports the following arguments:
|
||||||
"url": Required relative url of the image, e.g. "img/example.jpg"
|
"url": Required relative url of the image, e.g. "img/example.jpg"
|
||||||
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". Other values are ignored.
|
"ratio": Optional ratio of the image, either "1x1", "4x3", "16x9", or "21x9". If set, the image is
|
||||||
Instead, the original aspect ratio of the image is preserved.
|
resized and cropped to match the ratio. Else the original aspect ratio of the image is kept.
|
||||||
"outerClass": Optional class attribute of the outer div element, e.g. "img-wrap".
|
"outerClass": Optional class attribute of the outer div element, e.g. "img-wrap".
|
||||||
"innerClass": Optional class attribute of the inner img element, e.g. "rounded".
|
"innerClass": Optional class attribute of the inner img element, e.g. "rounded".
|
||||||
"title": Optional alternate text of the image.
|
"title": Optional alternate text of the image.
|
||||||
@@ -62,12 +62,27 @@
|
|||||||
{{ $xxlDim = printf "1400x%d" (int (math.Round (mul (div 1400.0 $img.Width) $img.Height))) -}}
|
{{ $xxlDim = printf "1400x%d" (int (math.Round (mul (div 1400.0 $img.Width) $img.Height))) -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{- $sm := ($img.Fill (printf "%s webp" $smDim)) -}}
|
{{- $sm := "" -}}
|
||||||
{{ $md := ($img.Fill (printf "%s webp" $mdDim)) -}}
|
{{ $md := "" -}}
|
||||||
{{ $lg := ($img.Fill (printf "%s webp" $lgDim)) -}}
|
{{ $lg := "" -}}
|
||||||
{{ $xl := ($img.Fill (printf "%s webp" $xlDim)) -}}
|
{{ $xl := "" -}}
|
||||||
{{ $xxl := ($img.Fill (printf "%s webp" $xxlDim)) -}}
|
{{ $xxl := "" -}}
|
||||||
{{ $fallback := ($img.Fill (printf "%s jpg" $xxlDim)) -}}
|
{{ $fallback := "" -}}
|
||||||
|
{{ if $ratio }}
|
||||||
|
{{- $sm = ($img.Fill (printf "%s webp" $smDim)) -}}
|
||||||
|
{{ $md = ($img.Fill (printf "%s webp" $mdDim)) -}}
|
||||||
|
{{ $lg = ($img.Fill (printf "%s webp" $lgDim)) -}}
|
||||||
|
{{ $xl = ($img.Fill (printf "%s webp" $xlDim)) -}}
|
||||||
|
{{ $xxl = ($img.Fill (printf "%s webp" $xxlDim)) -}}
|
||||||
|
{{ $fallback = ($img.Fill (printf "%s jpg" $xxlDim)) -}}
|
||||||
|
{{ else }}
|
||||||
|
{{- $sm = ($img.Fit (printf "%s webp" $smDim)) -}}
|
||||||
|
{{ $md = ($img.Fit (printf "%s webp" $mdDim)) -}}
|
||||||
|
{{ $lg = ($img.Fit (printf "%s webp" $lgDim)) -}}
|
||||||
|
{{ $xl = ($img.Fit (printf "%s webp" $xlDim)) -}}
|
||||||
|
{{ $xxl = ($img.Fit (printf "%s webp" $xxlDim)) -}}
|
||||||
|
{{ $fallback = ($img.Fit (printf "%s jpg" $xxlDim)) -}}
|
||||||
|
{{ end}}
|
||||||
|
|
||||||
{{- with $caption -}}
|
{{- with $caption -}}
|
||||||
<figure class="figure">
|
<figure class="figure">
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@markdumay/hugo-theme-hinode",
|
"name": "@markdumay/hugo-theme-hinode",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@markdumay/hugo-theme-hinode",
|
"name": "@markdumay/hugo-theme-hinode",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@markdumay/hugo-theme-hinode",
|
"name": "@markdumay/hugo-theme-hinode",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"description": "Hinode is a clean blog theme for Hugo, an open-source static site generator",
|
"description": "Hinode is a clean blog theme for Hugo, an open-source static site generator",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
|
Reference in New Issue
Block a user