From 96c8bf099f4f8ee5089e7cd8a7e6a2b48211f6aa Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 16 Aug 2025 01:20:06 +0100 Subject: [PATCH] feat(blox-tailwind): add support for Hugo v0.148 --- modules/blox-tailwind/hugo.yaml | 4 ++-- .../layouts/_default/single.html | 2 ++ .../_default/{_markup => }/sitemap.xml | 0 .../partials/page_metadata_authors.html | 5 ++--- .../blox-tailwind/layouts/partials/tags.html | 5 ++--- .../layouts/partials/views/article-grid.html | 20 +++++++++++-------- 6 files changed, 20 insertions(+), 16 deletions(-) rename modules/blox-tailwind/layouts/_default/{_markup => }/sitemap.xml (100%) diff --git a/modules/blox-tailwind/hugo.yaml b/modules/blox-tailwind/hugo.yaml index 7b42fb10..fbb27354 100644 --- a/modules/blox-tailwind/hugo.yaml +++ b/modules/blox-tailwind/hugo.yaml @@ -4,7 +4,7 @@ markup: renderHooks: link: # Process backlinks hook - enableDefault: true + useEmbedded: fallback renderer: # Render HTML in Markdown unsafe: true @@ -58,7 +58,7 @@ sitemap: changefreq: weekly module: hugoVersion: - min: '0.134.1' + min: '0.148.2' extended: true imports: - path: github.com/HugoBlox/hugo-blox-builder/modules/blox-analytics diff --git a/modules/blox-tailwind/layouts/_default/single.html b/modules/blox-tailwind/layouts/_default/single.html index a5ef4ab7..f148e2a4 100644 --- a/modules/blox-tailwind/layouts/_default/single.html +++ b/modules/blox-tailwind/layouts/_default/single.html @@ -110,9 +110,11 @@ {{ if $pub_type_display }}
{{ i18n "publication_type" }}
+ {{ if and .Params.publication_types (gt (len .Params.publication_types) 0) }} {{ $pub_type_display }} + {{ end }}
{{ end }} diff --git a/modules/blox-tailwind/layouts/_default/_markup/sitemap.xml b/modules/blox-tailwind/layouts/_default/sitemap.xml similarity index 100% rename from modules/blox-tailwind/layouts/_default/_markup/sitemap.xml rename to modules/blox-tailwind/layouts/_default/sitemap.xml diff --git a/modules/blox-tailwind/layouts/partials/page_metadata_authors.html b/modules/blox-tailwind/layouts/partials/page_metadata_authors.html index 07707650..b1cfb311 100644 --- a/modules/blox-tailwind/layouts/partials/page_metadata_authors.html +++ b/modules/blox-tailwind/layouts/partials/page_metadata_authors.html @@ -1,8 +1,7 @@ {{/* Display author list. */}} -{{- $taxonomy := "authors" }} -{{ if .Param $taxonomy }} - {{ range $index, $value := (.GetTerms $taxonomy) }} +{{ if .Params.authors }} + {{ range $index, $value := (.GetTerms "authors") }} {{- /* Highlight the author's name? */ -}} {{- $highlight_name := .Page.Params.highlight_name | default false -}} diff --git a/modules/blox-tailwind/layouts/partials/tags.html b/modules/blox-tailwind/layouts/partials/tags.html index 96feeda0..e2dd27a6 100644 --- a/modules/blox-tailwind/layouts/partials/tags.html +++ b/modules/blox-tailwind/layouts/partials/tags.html @@ -1,7 +1,6 @@ -{{ $taxonomy := "tags" }} -{{ if .Param $taxonomy }} +{{ if .Params.tags }}
- {{ range $index, $value := (.GetTerms $taxonomy) }} + {{ range $index, $value := (.GetTerms "tags") }} {{ .LinkTitle }} {{ end }}
diff --git a/modules/blox-tailwind/layouts/partials/views/article-grid.html b/modules/blox-tailwind/layouts/partials/views/article-grid.html index 1b30750a..254ea6ab 100644 --- a/modules/blox-tailwind/layouts/partials/views/article-grid.html +++ b/modules/blox-tailwind/layouts/partials/views/article-grid.html @@ -38,12 +38,14 @@ {{end}}
-
- {{ range $index, $value := first 1 ($item.GetTerms "tags") }} - {{ .Page.LinkTitle }} - {{end}} -
+
+ {{ if and $item.Params.tags (gt (len $item.Params.tags) 0) }} + {{ range $index, $value := first 1 ($item.GetTerms "tags") }} + {{ .Page.LinkTitle }} + {{end}} + {{ end }} +

--> {{ if $item.Params.authors }}
- {{ range $index, $value := first 1 ($item.GetTerms "authors") }} -
+ {{ if and $item.Params.authors (gt (len $item.Params.authors) 0) }} + {{ range $index, $value := first 1 ($item.GetTerms "authors") }} +
{{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} {{ if $avatar }} {{ $authorImage := $avatar.Process "Fill 50x50 Center 95 webp" }} @@ -86,6 +89,7 @@
{{end}} + {{ end }} • {{end}}