Compare commits

...

15 Commits

Author SHA1 Message Date
Mark Dumay
bcf9b8aa7c Merge pull request #993 from gethinode/develop
Use image helpers for SEO thumbnail
2024-06-12 08:07:19 +02:00
Mark Dumay
15d0161240 Merge branch 'main' into develop 2024-06-12 08:01:05 +02:00
Mark Dumay
998db85994 Use image helpers for SEO thumbnail 2024-06-12 08:00:46 +02:00
Mark Dumay
e6586b52cd Merge pull request #992 from gethinode/develop
Remove spacing from pagination buttons
2024-06-10 07:05:06 +02:00
Mark Dumay
937964a02b Merge branch 'main' into develop 2024-06-10 06:56:39 +02:00
Mark Dumay
9b4afdfb35 Merge pull request #985 from gethinode/hugo-mod-dependencies
Update Hugo module dependencies
2024-06-10 06:56:15 +02:00
Mark Dumay
2121e663a0 Bump package release 2024-06-10 06:55:59 +02:00
Mark Dumay
46699664dc Remove spacing from pagination buttons 2024-06-10 06:55:00 +02:00
markdumay
98ec788fb3 fix: update Hugo module dependencies 2024-06-07 03:06:28 +00:00
github-actions[bot]
e248862905 Merge pull request #989 from gethinode/dependabot/npm_and_yarn/hugo-bin-0.124.0
Bump hugo-bin from 0.123.3 to 0.124.0
2024-06-06 13:13:31 +00:00
dependabot[bot]
8ba8acf675 Bump hugo-bin from 0.123.3 to 0.124.0
Bumps [hugo-bin](https://github.com/fenneclab/hugo-bin) from 0.123.3 to 0.124.0.
- [Release notes](https://github.com/fenneclab/hugo-bin/releases)
- [Commits](https://github.com/fenneclab/hugo-bin/compare/v0.123.3...v0.124.0)

---
updated-dependencies:
- dependency-name: hugo-bin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 13:07:40 +00:00
github-actions[bot]
a7cf1ad918 Merge pull request #988 from gethinode/dependabot/npm_and_yarn/cssnano-7.0.2
Bump cssnano from 7.0.1 to 7.0.2
2024-06-05 14:12:55 +00:00
dependabot[bot]
492ce3e38b Bump cssnano from 7.0.1 to 7.0.2
Bumps [cssnano](https://github.com/cssnano/cssnano) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/cssnano/cssnano/releases)
- [Commits](https://github.com/cssnano/cssnano/compare/cssnano@7.0.1...cssnano@7.0.2)

---
updated-dependencies:
- dependency-name: cssnano
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 14:08:02 +00:00
github-actions[bot]
eaa5c217db Merge pull request #987 from gethinode/dependabot/npm_and_yarn/cssnano-preset-advanced-7.0.2
Bump cssnano-preset-advanced from 7.0.1 to 7.0.2
2024-06-05 14:07:17 +00:00
dependabot[bot]
410d681d23 Bump cssnano-preset-advanced from 7.0.1 to 7.0.2
Bumps [cssnano-preset-advanced](https://github.com/cssnano/cssnano) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/cssnano/cssnano/releases)
- [Commits](https://github.com/cssnano/cssnano/compare/cssnano-preset-advanced@7.0.1...cssnano-preset-advanced@7.0.2)

---
updated-dependencies:
- dependency-name: cssnano-preset-advanced
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 14:02:55 +00:00
8 changed files with 223 additions and 163 deletions

2
go.mod
View File

@@ -9,7 +9,7 @@ require (
github.com/gethinode/mod-fontawesome v1.9.0 // indirect github.com/gethinode/mod-fontawesome v1.9.0 // indirect
github.com/gethinode/mod-katex v1.1.0 // indirect github.com/gethinode/mod-katex v1.1.0 // indirect
github.com/gethinode/mod-leaflet v1.1.0 // indirect github.com/gethinode/mod-leaflet v1.1.0 // indirect
github.com/gethinode/mod-lottie v1.5.3 // indirect github.com/gethinode/mod-lottie v1.5.4 // indirect
github.com/gethinode/mod-utils/v2 v2.3.7 // indirect github.com/gethinode/mod-utils/v2 v2.3.7 // indirect
github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85 // indirect
github.com/twbs/bootstrap v5.3.3+incompatible // indirect github.com/twbs/bootstrap v5.3.3+incompatible // indirect

2
go.sum
View File

@@ -180,6 +180,8 @@ github.com/gethinode/mod-lottie v1.5.2 h1:UvrNAQeD/97Q5fbv3uKIY48fY3IWJeLy/v206G
github.com/gethinode/mod-lottie v1.5.2/go.mod h1:HM1pA85EiPO7RtNysw/a2ZzRqktO2WvB/KyWLOuynzg= github.com/gethinode/mod-lottie v1.5.2/go.mod h1:HM1pA85EiPO7RtNysw/a2ZzRqktO2WvB/KyWLOuynzg=
github.com/gethinode/mod-lottie v1.5.3 h1:fvCjCoZoCEhY2aou30oEsEo6N4tVSI0ijFyXS3wNib0= github.com/gethinode/mod-lottie v1.5.3 h1:fvCjCoZoCEhY2aou30oEsEo6N4tVSI0ijFyXS3wNib0=
github.com/gethinode/mod-lottie v1.5.3/go.mod h1:XHVMuPsuJIm9/Eb2ql4jsT49/BQqMlBiirQoty4uHAo= github.com/gethinode/mod-lottie v1.5.3/go.mod h1:XHVMuPsuJIm9/Eb2ql4jsT49/BQqMlBiirQoty4uHAo=
github.com/gethinode/mod-lottie v1.5.4 h1:+xbamSsjcnP2tyzGl0CA1enma7gkAp67wenmuP0XELY=
github.com/gethinode/mod-lottie v1.5.4/go.mod h1:gALqz48aYpoDLxJOI3LzIpdy0Eq/lOBNtlcOxABa9tg=
github.com/gethinode/mod-utils v1.0.0 h1:cqHm2xS5uDiJzRm1KfHaNbq6uMVDKLhQa8/BuTZ1nhY= github.com/gethinode/mod-utils v1.0.0 h1:cqHm2xS5uDiJzRm1KfHaNbq6uMVDKLhQa8/BuTZ1nhY=
github.com/gethinode/mod-utils v1.0.0/go.mod h1:ONJm3pHCq7nvaPNjusLZNCeCbhOhSBH4HVKHwK1FdYE= github.com/gethinode/mod-utils v1.0.0/go.mod h1:ONJm3pHCq7nvaPNjusLZNCeCbhOhSBH4HVKHwK1FdYE=
github.com/gethinode/mod-utils v1.0.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE= github.com/gethinode/mod-utils v1.0.1 h1:jhZGlGFHHL1f5HXbBMXfiZ2gCz4TVafAzjnRPTIBSEE=

View File

@@ -16,12 +16,8 @@
{{- $modes := .modes -}} {{- $modes := .modes -}}
{{- $plain := .plain | default false }} {{- $plain := .plain | default false }}
{{- $fallbackURL := "" -}}
{{- $anchor := "" -}}
{{- $imgset := "" -}}
{{- $isVector := false -}}
<!-- Split url into base and anchor when applicable (only relevant for vector images) --> <!-- Split url into base and anchor when applicable (only relevant for vector images) -->
{{- $anchor := "" -}}
{{- $segments := split $url "#" -}} {{- $segments := split $url "#" -}}
{{- if gt (len $segments) 2 -}} {{- if gt (len $segments) 2 -}}
{{- errorf "Invalid path or url: %q" $url -}} {{- errorf "Invalid path or url: %q" $url -}}
@@ -30,82 +26,18 @@
{{- $anchor = index $segments 1 -}} {{- $anchor = index $segments 1 -}}
{{- end -}} {{- end -}}
<!-- Identify image provider --> <!-- Obtain fallback URL and imageset definition -->
{{ $hook := "" }} {{ $target := partial "assets/helpers/image-dimension.html" (dict
{{ $account := "" }} "page" $page
{{ $container := "" }} "url" .url
{{ $rewrite := false }} "ratio" $ratio
{{ range $provider, $val := site.Params.images }} "plain" $plain
{{ if not $hook }} "imageset" true
{{ with index $val "host" }} ) }}
{{ if (findRE . (urls.Parse $url).Hostname) }} {{ $fallbackURL := index $target "target" }}
{{ $hook = $provider }} {{ $imgset := index $target "set" }}
{{ with index $val "account" }}{{ $account = . }}{{ end }} {{ $height := index $target "height" }}
{{ with index $val "rewrite" }}{{ $rewrite = . }}{{ end }} {{ $width := index $target "width" }}
{{ with index $val "container" }}{{ $container = . }}{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not $hook }}{{ $hook = "hugo" }}{{ end }}
<!-- Rewrite the origin URL if applicable -->
{{ if $rewrite }}
{{ $url = partial "assets/helpers/image-rewrite.html" (dict "url" $url "account" $account "container" $container "hook" $hook) }}
{{ end }}
<!-- Define image dimensions -->
{{ $dims := slice }}
{{- $res := "" -}}
{{- $img := "" -}}
{{ $transform := "" }}
{{- if hasSuffix $url "svg" -}}
{{- $res = partial "utilities/GetResource.html" (dict "url" $url "page" $page) -}}
{{ if not $res }}
{{- if not (fileExists (path.Join "/static" $url)) -}}
{{ warnf "Cannot find vector image resource: %q" $url -}}
{{ else }}
{{ $width := string (partial "utilities/GetWidth.html" (dict "path" $url "height" 500)) }}
{{ $dims = $dims | append (printf "%sx500" $width) }}
{{ end }}
{{ end }}
{{ else if $ratio }}
{{ $transform = "fill" }}
{{ $dims = partial "assets/helpers/GetDimension.html" (dict "ratio" $ratio) }}
{{ if not $dims }}{{ errorf "partial [assets/image.html] - Cannot find dimension data: %s" $ratio }}{{ end }}
{{ else if not $plain }}
{{ $transform = "fit" }}
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
{{ if and $res $res.resource }}
{{ $img = $res.resource }}
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
{{ range $width := $widths -}}
{{- $dims = $dims | append (printf "%dx%d" (int $width) (int (math.Round (mul (div (float $width) $img.Width) $img.Height)))) -}}
{{- end -}}
{{ end }}
{{ end }}
<!-- Derive image width and height -->
{{ $width := "" }}
{{ $height := "" }}
{{ if not $plain }}
{{ with $dims }}
{{ range $dim := (. | last 1) }}
{{ $width = (int (index (split $dim "x") 0)) }}
{{ $height = (int (index (split $dim "x") 1)) }}
{{ end }}
{{ end }}
{{ end }}
<!-- Generate image urls -->
{{ if or (hasSuffix $url "svg") $plain }}
{{- $fallbackURL = partial "utilities/GetStaticURL" (dict "url" $url) -}}
{{ else }}
{{- $fallbackURL = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" ($dims | last 1) "transform" $transform "hook" $hook "format" "jpg" "includeWidth" false) -}}
{{- $imgset = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" $dims "transform" $transform "hook" $hook) -}}
{{ end }}
<!-- Add color modes --> <!-- Add color modes -->
{{- range $none := $modes -}} {{- range $none := $modes -}}

View File

@@ -0,0 +1,109 @@
<!-- Initialize arguments -->
{{- $page := .page -}}
{{- $url := .url -}}
{{- $ratio := .ratio -}}
{{- $height := .height -}}
{{- $width := .width -}}
{{- $plain := .plain | default false }}
{{- $targetURL := "" -}}
{{- $set := "" -}}
{{- $imageset := .imageset | default false }}
<!-- Split url into base and anchor when applicable (only relevant for vector images) -->
{{- $segments := split $url "#" -}}
{{- if gt (len $segments) 2 -}}
{{- errorf "Invalid path or url: %q" $url -}}
{{- else if eq (len $segments) 2 }}
{{- $url = index $segments 0 -}}
{{- end -}}
<!-- Identify image provider -->
{{ $hook := "" }}
{{ $account := "" }}
{{ $container := "" }}
{{ $rewrite := false }}
{{ range $provider, $val := site.Params.images }}
{{ if not $hook }}
{{ with index $val "host" }}
{{ if (findRE . (urls.Parse $url).Hostname) }}
{{ $hook = $provider }}
{{ with index $val "account" }}{{ $account = . }}{{ end }}
{{ with index $val "rewrite" }}{{ $rewrite = . }}{{ end }}
{{ with index $val "container" }}{{ $container = . }}{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not $hook }}{{ $hook = "hugo" }}{{ end }}
<!-- Rewrite the origin URL if applicable -->
{{ if $rewrite }}
{{ $url = partial "assets/helpers/image-rewrite.html" (dict "url" $url "account" $account "container" $container "hook" $hook) }}
{{ end }}
<!-- Define image dimensions -->
{{ $dims := slice }}
{{- $res := "" -}}
{{- $img := "" -}}
{{ $transform := "" }}
{{- if hasSuffix $url "svg" -}}
{{- $res = partial "utilities/GetResource.html" (dict "url" $url "page" $page) -}}
{{ if not $res }}
{{- if not (fileExists (path.Join "/static" $url)) -}}
{{ warnf "Cannot find vector image resource: %q" $url -}}
{{ else }}
{{ $width := string (partial "utilities/GetWidth.html" (dict "path" $url "height" 500)) }}
{{ $dims = $dims | append (printf "%sx500" $width) }}
{{ end }}
{{ end }}
{{ else if $ratio }}
{{ $transform = "fill" }}
{{ $dims = partial "assets/helpers/GetDimension.html" (dict "ratio" $ratio) }}
{{ if not $dims }}{{ errorf "partial [assets/image.html] - Cannot find dimension data: %s" $ratio }}{{ end }}
{{ else if (and $height $width) }}
{{ $transform = "fill" }}
{{ $dims = slice (printf "%dx%d" $width $height) }}
{{ else if not $plain }}
{{ $transform = "fit" }}
{{- $res := partial "utilities/GetImage.html" (dict "url" $url "page" $page) -}}
{{ if and $res $res.resource }}
{{ $img = $res.resource }}
{{ if $res.mirror }}{{ $class = printf "%s mirrorred" $class }}{{ end }}
{{ $widths := partial "assets/helpers/GetDimension.html" (dict "ratio" "auto") }}
{{ range $w := $widths -}}
{{ $height = int (math.Round (mul (div (float $w) $img.Width) $img.Height)) }}
{{- $dims = $dims | append (printf "%dx%d" (int $w) $height ) -}}
{{- end -}}
{{ end }}
{{ end }}
<!-- Derive image width and height -->
{{ if not $plain }}
{{ with $dims }}
{{ range $dim := (. | last 1) }}
{{ $width = (int (index (split $dim "x") 0)) }}
{{ $height = (int (index (split $dim "x") 1)) }}
{{ end }}
{{ end }}
{{ end }}
<!-- Generate image url -->
{{ if or (hasSuffix $url "svg") $plain }}
{{- $targetURL = partial "utilities/GetStaticURL" (dict "url" $url) -}}
{{ else }}
{{- $targetURL = partial "assets/helpers/image-set.html" (dict
"url" $url
"img" $img
"dims" ($dims | last 1)
"transform" $transform
"hook" $hook
"format" "jpg"
"includeWidth" false
)}}
{{ if $imageset }}
{{- $set = partial "assets/helpers/image-set.html" (dict "url" $url "img" $img "dims" $dims "transform" $transform "hook" $hook) -}}
{{ end }}
{{ end }}
{{ return (dict "target" $targetURL "set" $set "height" $height "width" $width) }}

View File

@@ -21,22 +21,30 @@
{{- with .First }} {{- with .First }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Prev }} {{- with .Prev }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
@@ -61,22 +69,30 @@
{{- with .Next }} {{- with .Next }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationNext" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- with .Last }} {{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- else }} {{- else }}
<li class="page-item disabled"> <li class="page-item disabled">
<a aria-disabled="true" aria-label="{{ T "paginationLast" }}" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a aria-disabled="true" aria-label="{{ T "paginationLast" }}" class="page-link" role="button" tabindex="-1">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
@@ -90,14 +106,18 @@
{{- with .First }} {{- with .First }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationFirst" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .Prev }} {{- with .Prev }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationPrevious" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-left" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
@@ -122,14 +142,18 @@
{{- with .Next }} {{- with .Next }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationNext" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angle-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- with .Last }} {{- with .Last }}
{{- if ne $currentPageNumber .PageNumber }} {{- if ne $currentPageNumber .PageNumber }}
<li class="page-item"> <li class="page-item">
<a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button"><span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right") }}</span></a> <a href="{{ .URL }}" aria-label="{{ T "paginationLast" }}" class="page-link" role="button">
<span aria-hidden="true">{{ partial "assets/icon.html" (dict "icon" "fas angles-right" "spacing" false) }}</span>
</a>
</li> </li>
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -15,15 +15,8 @@
{{- $thumbnail := (or (and (reflect.IsMap .Params.Thumbnail) .Params.Thumbnail.url) .Params.Thumbnail) -}} {{- $thumbnail := (or (and (reflect.IsMap .Params.Thumbnail) .Params.Thumbnail.url) .Params.Thumbnail) -}}
{{ with $thumbnail -}} {{ with $thumbnail -}}
{{- $res := partial "utilities/GetImage.html" (dict "url" .) -}} {{ $imgURL := index (partial "assets/helpers/image-dimension.html" (dict "url" $thumbnail "width" 1280 "height" 640 "page" .)) "target" }}
{{- $img := "" -}} {{ $.Scratch.Set "thumbnail" ($imgURL | absURL) -}}
{{ with $res }}{{ $img = $res.resource }}{{ end }}
{{ with $img -}}
{{ $dim := "1280x640" -}}
{{ $scaled := (.Fill (printf "%s jpg" $dim)) -}}
{{- $scaled = $scaled | resources.Copy (replace $img.RelPermalink ".jpg" (printf "-%s.jpg" $dim)) -}}
{{ $.Scratch.Set "thumbnail" ($scaled.Permalink | absURL) -}}
{{ end -}}
{{ else -}} {{ else -}}
{{ with .Site.Params.schema.image.url -}} {{ with .Site.Params.schema.image.url -}}
{{ $.Scratch.Set "thumbnail" (. | absURL) -}} {{ $.Scratch.Set "thumbnail" (. | absURL) -}}

112
package-lock.json generated
View File

@@ -1,19 +1,19 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.24.1", "version": "0.24.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.24.1", "version": "0.24.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0", "@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"cssnano": "^7.0.1", "cssnano": "^7.0.2",
"cssnano-preset-advanced": "^7.0.1", "cssnano-preset-advanced": "^7.0.2",
"hugo-bin": "0.123.3", "hugo-bin": "0.124.0",
"purgecss-whitelister": "^2.4.0" "purgecss-whitelister": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {
@@ -2101,11 +2101,11 @@
} }
}, },
"node_modules/cssnano": { "node_modules/cssnano": {
"version": "7.0.1", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-7.0.1.tgz", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-7.0.2.tgz",
"integrity": "sha512-917Mej/4SdI7b55atsli3sU4MOJ9XDoKgnlCtQtXYj8XUFcM3riTuYHyqBBnnskawW+zWwp0KxJzpEUodlpqUg==", "integrity": "sha512-LXm/Xx6TNLzfHM2lBaIQHfvtdW5QfdbyLzfJAWZrclCAb47yVa0/yJG69+amcw3Lq0YZ+kyU40rbsMPLcMt9aw==",
"dependencies": { "dependencies": {
"cssnano-preset-default": "^7.0.1", "cssnano-preset-default": "^7.0.2",
"lilconfig": "^3.1.1" "lilconfig": "^3.1.1"
}, },
"engines": { "engines": {
@@ -2120,14 +2120,14 @@
} }
}, },
"node_modules/cssnano-preset-advanced": { "node_modules/cssnano-preset-advanced": {
"version": "7.0.1", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-7.0.1.tgz", "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-7.0.2.tgz",
"integrity": "sha512-y1NE/+WiKPnR/kVrUPeYrX3oWb9iHQZ3+KhNH++UTOgbLS7yJtC6nOkisnP90A5mQXLhpK8OjjxYEe9kAmRAnA==", "integrity": "sha512-RWl8eouQxOiWNfid5lYnKE/qtE9fHr2cLZOqfxHHNGrLMhvRBMh/PTmFjhQOoLmAUlQaZVtwjWiYnr99rYBBbw==",
"dependencies": { "dependencies": {
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"browserslist": "^4.23.0", "browserslist": "^4.23.0",
"cssnano-preset-default": "^7.0.1", "cssnano-preset-default": "^7.0.2",
"postcss-discard-unused": "^7.0.0", "postcss-discard-unused": "^7.0.1",
"postcss-merge-idents": "^7.0.0", "postcss-merge-idents": "^7.0.0",
"postcss-reduce-idents": "^7.0.0", "postcss-reduce-idents": "^7.0.0",
"postcss-zindex": "^7.0.0" "postcss-zindex": "^7.0.0"
@@ -2140,9 +2140,9 @@
} }
}, },
"node_modules/cssnano-preset-default": { "node_modules/cssnano-preset-default": {
"version": "7.0.1", "version": "7.0.2",
"resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-7.0.1.tgz", "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-7.0.2.tgz",
"integrity": "sha512-Fumyr+uZMcjYQeuHssAZxn0cKj3cdQc5GcxkBcmEzISGB+UW9CLNlU4tBOJbJGcPukFDlicG32eFbrc8K9V5pw==", "integrity": "sha512-z95kGKZx8VWHfERj7LFzuiTxylbvEp07ZEYaFu+t6bFyNOXLd/+3oPyNaY7ISwcrfHFCkt8OfRo4IZxVRJZ7dg==",
"dependencies": { "dependencies": {
"browserslist": "^4.23.0", "browserslist": "^4.23.0",
"css-declaration-sorter": "^7.2.0", "css-declaration-sorter": "^7.2.0",
@@ -2154,12 +2154,12 @@
"postcss-discard-duplicates": "^7.0.0", "postcss-discard-duplicates": "^7.0.0",
"postcss-discard-empty": "^7.0.0", "postcss-discard-empty": "^7.0.0",
"postcss-discard-overridden": "^7.0.0", "postcss-discard-overridden": "^7.0.0",
"postcss-merge-longhand": "^7.0.0", "postcss-merge-longhand": "^7.0.1",
"postcss-merge-rules": "^7.0.0", "postcss-merge-rules": "^7.0.1",
"postcss-minify-font-values": "^7.0.0", "postcss-minify-font-values": "^7.0.0",
"postcss-minify-gradients": "^7.0.0", "postcss-minify-gradients": "^7.0.0",
"postcss-minify-params": "^7.0.0", "postcss-minify-params": "^7.0.0",
"postcss-minify-selectors": "^7.0.0", "postcss-minify-selectors": "^7.0.1",
"postcss-normalize-charset": "^7.0.0", "postcss-normalize-charset": "^7.0.0",
"postcss-normalize-display-values": "^7.0.0", "postcss-normalize-display-values": "^7.0.0",
"postcss-normalize-positions": "^7.0.0", "postcss-normalize-positions": "^7.0.0",
@@ -2172,8 +2172,8 @@
"postcss-ordered-values": "^7.0.0", "postcss-ordered-values": "^7.0.0",
"postcss-reduce-initial": "^7.0.0", "postcss-reduce-initial": "^7.0.0",
"postcss-reduce-transforms": "^7.0.0", "postcss-reduce-transforms": "^7.0.0",
"postcss-svgo": "^7.0.0", "postcss-svgo": "^7.0.1",
"postcss-unique-selectors": "^7.0.0" "postcss-unique-selectors": "^7.0.1"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -4309,9 +4309,9 @@
"dev": true "dev": true
}, },
"node_modules/hugo-bin": { "node_modules/hugo-bin": {
"version": "0.123.3", "version": "0.124.0",
"resolved": "https://registry.npmjs.org/hugo-bin/-/hugo-bin-0.123.3.tgz", "resolved": "https://registry.npmjs.org/hugo-bin/-/hugo-bin-0.124.0.tgz",
"integrity": "sha512-30lebZNVnrpDo5HV5RbCHZ3WhYXsrvUJ0EyJkoYXMd8SHs2HZuc3s0O7RY7aP+pkC9SX3ahU9rNsB9bcKuSw1g==", "integrity": "sha512-5Vi0XZ0wJS8tmp+RzYwhfAS6gBtU9ZcaVmGHVl7RSiYzbuFVA8YDhsdFry2kZPf2ZOlA3uZuVDJmVCRVzit7xw==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@@ -6546,11 +6546,11 @@
} }
}, },
"node_modules/postcss-discard-unused": { "node_modules/postcss-discard-unused": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-7.0.1.tgz",
"integrity": "sha512-NgjhdrBA0Gc0atkp2a5usobonNh5kb/RmnVJoYz8X6m3wD+Mwc+rJz6flo7veaUhb5ZLsjx8Kc04LBzXNLYGwQ==", "integrity": "sha512-3myaiuHge0HaY+OMA42/xlXnVixhPQPmfxrpiLO3FBipgW/4A3UnWnAtlfo49tuxsCx4ZrS6+h/sa/68WNGWPg==",
"dependencies": { "dependencies": {
"postcss-selector-parser": "^6.0.16" "postcss-selector-parser": "^6.1.0"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -6616,12 +6616,12 @@
} }
}, },
"node_modules/postcss-merge-longhand": { "node_modules/postcss-merge-longhand": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-7.0.1.tgz",
"integrity": "sha512-0X8I4/9+G03X5/5NnrfopG/YEln2XU8heDh7YqBaiq2SeaKIG3n66ShZPjIolmVuLBQ0BEm3yS8o1mlCLHdW7A==", "integrity": "sha512-qZlD26hnqSTMxSSOMS8+QCeRWtqOdMKeQHvHcBhjL3mJxKUs47cvO1Y1x3iTdYIk3ioMcRHTiy229TT0mEMH/A==",
"dependencies": { "dependencies": {
"postcss-value-parser": "^4.2.0", "postcss-value-parser": "^4.2.0",
"stylehacks": "^7.0.0" "stylehacks": "^7.0.1"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -6631,14 +6631,14 @@
} }
}, },
"node_modules/postcss-merge-rules": { "node_modules/postcss-merge-rules": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-7.0.1.tgz",
"integrity": "sha512-Zty3VlOsD6VSjBMu6PiHCVpLegtBT/qtZRVBcSeyEZ6q1iU5qTYT0WtEoLRV+YubZZguS5/ycfP+NRiKfjv6aw==", "integrity": "sha512-bb8McYQbo2etgs0uVt6AfngajACK3FHSVP3sGLhprrjbtHJWgG03JZ4KKBlJ8/5Fb8/Rr+mMKaybMYeoYrAg0A==",
"dependencies": { "dependencies": {
"browserslist": "^4.23.0", "browserslist": "^4.23.0",
"caniuse-api": "^3.0.0", "caniuse-api": "^3.0.0",
"cssnano-utils": "^5.0.0", "cssnano-utils": "^5.0.0",
"postcss-selector-parser": "^6.0.16" "postcss-selector-parser": "^6.1.0"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -6694,11 +6694,11 @@
} }
}, },
"node_modules/postcss-minify-selectors": { "node_modules/postcss-minify-selectors": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-7.0.1.tgz",
"integrity": "sha512-f00CExZhD6lNw2vTZbcnmfxVgaVKzUw6IRsIFX3JTT8GdsoABc1WnhhGwL1i8YPJ3sSWw39fv7XPtvLb+3Uitw==", "integrity": "sha512-YfIbGtcgMFquPxV2L/ASs36ZS4DsgfcDX9tQ8cTEIvBTv+0GXFKtcvvpi9tCKto/+DWGWYKMCESFG3Pnan0Feg==",
"dependencies": { "dependencies": {
"postcss-selector-parser": "^6.0.16" "postcss-selector-parser": "^6.1.0"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -6980,12 +6980,12 @@
} }
}, },
"node_modules/postcss-svgo": { "node_modules/postcss-svgo": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-7.0.1.tgz",
"integrity": "sha512-Xj5DRdvA97yRy3wjbCH2NKXtDUwEnph6EHr5ZXszsBVKCNrKXYBjzAXqav7/Afz5WwJ/1peZoTguCEJIg7ytmA==", "integrity": "sha512-0WBUlSL4lhD9rA5k1e5D8EN5wCEyZD6HJk0jIvRxl+FDVOMlJ7DePHYWGGVc5QRqrJ3/06FTXM0bxjmJpmTPSA==",
"dependencies": { "dependencies": {
"postcss-value-parser": "^4.2.0", "postcss-value-parser": "^4.2.0",
"svgo": "^3.2.0" "svgo": "^3.3.2"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >= 18" "node": "^18.12.0 || ^20.9.0 || >= 18"
@@ -6995,11 +6995,11 @@
} }
}, },
"node_modules/postcss-unique-selectors": { "node_modules/postcss-unique-selectors": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-7.0.0.tgz", "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-7.0.1.tgz",
"integrity": "sha512-NYFqcft7vVQMZlQPsMdMPy+qU/zDpy95Malpw4GeA9ZZjM6dVXDshXtDmLc0m4WCD6XeZCJqjTfPT1USsdt+rA==", "integrity": "sha512-MH7QE/eKUftTB5ta40xcHLl7hkZjgDFydpfTK+QWXeHxghVt3VoPqYL5/G+zYZPPIs+8GuqFXSTgxBSoB1RZtQ==",
"dependencies": { "dependencies": {
"postcss-selector-parser": "^6.0.16" "postcss-selector-parser": "^6.1.0"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -8575,12 +8575,12 @@
} }
}, },
"node_modules/stylehacks": { "node_modules/stylehacks": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-7.0.0.tgz", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-7.0.1.tgz",
"integrity": "sha512-47Nw4pQ6QJb4CA6dzF2m9810sjQik4dfk4UwAm5wlwhrW3syzZKF8AR4/cfO3Cr6lsFgAoznQq0Wg57qhjTA2A==", "integrity": "sha512-PnrT4HzajnxbjfChpeBKLSpSykilnGBlD+pIffCoT5KbLur9fcL8uKRQJJap85byR2wCYZl/4Otk5eq76qeZxQ==",
"dependencies": { "dependencies": {
"browserslist": "^4.23.0", "browserslist": "^4.23.0",
"postcss-selector-parser": "^6.0.16" "postcss-selector-parser": "^6.1.0"
}, },
"engines": { "engines": {
"node": "^18.12.0 || ^20.9.0 || >=22.0" "node": "^18.12.0 || ^20.9.0 || >=22.0"
@@ -8971,9 +8971,9 @@
"dev": true "dev": true
}, },
"node_modules/svgo": { "node_modules/svgo": {
"version": "3.2.0", "version": "3.3.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-3.2.0.tgz", "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz",
"integrity": "sha512-4PP6CMW/V7l/GmKRKzsLR8xxjdHTV4IMvhTnpuHwwBazSIlw5W/5SmPjN8Dwyt7lKbSJrRDgp4t9ph0HgChFBQ==", "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==",
"dependencies": { "dependencies": {
"@trysound/sax": "0.2.0", "@trysound/sax": "0.2.0",
"commander": "^7.2.0", "commander": "^7.2.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gethinode/hinode", "name": "@gethinode/hinode",
"version": "0.24.1", "version": "0.24.3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator", "description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [ "keywords": [
"hugo", "hugo",
@@ -69,9 +69,9 @@
"dependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^6.0.0", "@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"cssnano": "^7.0.1", "cssnano": "^7.0.2",
"cssnano-preset-advanced": "^7.0.1", "cssnano-preset-advanced": "^7.0.2",
"hugo-bin": "0.123.3", "hugo-bin": "0.124.0",
"purgecss-whitelister": "^2.4.0" "purgecss-whitelister": "^2.4.0"
}, },
"devDependencies": { "devDependencies": {