feat: add support for breaking changes in Hugo's templating system

See https://discord.com/channels/722225264733716590/738924091511144489/1406144559188283494
See https://gohugo.io/templates/new-templatesystem-overview/
This commit is contained in:
George Cushen committed 2025-08-16 23:12:42 +01:00
1 parent 655af4dd30
commit 33ebd99049
266 files changed
+34 -34

No files matched your search

@@ -1,7 +1,7 @@
{{ $provider := trim (site.Params.features.comment.provider | lower) " " }}
{{ if $provider }}
{{ $provider_tpl := printf "partials/comments/%s.html" $provider }}
{{ $provider_tpl := printf "_partials/comments/%s.html" $provider }}
{{ $provider_exists := templates.Exists $provider_tpl }}
{{ if not $provider_exists }}
{{ errorf "The '%s' comment provider was not found." $provider }}
@@ -11,7 +11,7 @@
{{ if eq $block_type "pages" }}{{ $block_type = "collection" }}{{ end }}{{/* Support legacy Pages block */}}
{{ if eq $block_type "featured" }}{{ $block_type = "collection" }}{{ end }}{{/* Support legacy Featured block */}}
{{ $widget_path := printf "blocks/v1/%s.html" $block_type }}
{{ if not (templates.Exists (printf "partials/%s" $widget_path)) }}
{{ if not (templates.Exists (printf "_partials/%s" $widget_path)) }}
{{ errorf "%s uses a `%s` block but the `%s` block was not found at `layouts/partials/%s`" $block.File.Path $block_type $block_type $widget_path }}
{{ end }}
@@ -102,7 +102,7 @@
{{ $widget_class := printf "wg-%s" (replace (replace $block_type "." "-") "_" "-") }}
{{ $widget_config_file := printf "blocks/v1/%s-config.html" $block_type }}
{{ if templates.Exists (printf "partials/%s" $widget_config_file) }}
{{ if templates.Exists (printf "_partials/%s" $widget_config_file) }}
{{ $cfg := partial $widget_config_file $widget_args }}
{{ $use_container = $cfg.use_container }}
{{end}}
@@ -7,7 +7,7 @@
{{ $block_type := lower $block.block | default "markdown" }}
{{ $block_path := printf "blocks/%s.html" $block_type }}
{{ if not (templates.Exists (printf "partials/%s" $block_path)) }}
{{ if not (templates.Exists (printf "_partials/%s" $block_path)) }}
{{ errorf "%s uses a `%s` block but the `%s` block was not found at `layouts/partials/%s`" $block.File.Path $block_type $block_type $block_path }}
{{ end }}
@@ -107,7 +107,7 @@
{{ $widget_class := printf "wg-%s" (replace (replace $block_type "." "-") "_" "-") }}
{{ $widget_config_file := printf "blocks/%s-config.html" $block_type }}
{{ if templates.Exists (printf "partials/%s" $widget_config_file) }}
{{ if templates.Exists (printf "_partials/%s" $widget_config_file) }}
{{ $cfg := partial $widget_config_file $widget_args }}
{{ with $cfg.use_container }}{{ $use_container = . }}{{ end }}
{{ with $cfg.inject_section_heading }}{{ $use_cols = . }}{{ end }}
@@ -21,7 +21,7 @@
{{ $view_file = "compact" }}
{{ end }}
{{else}}
{{ if templates.Exists (printf "partials/views/%s.html" (lower $view)) }}
{{ if templates.Exists (printf "_partials/views/%s.html" (lower $view)) }}
{{ $view_file = lower $view }}
{{else}}
{{/* Fallback to compact view */}}
@@ -5,7 +5,7 @@
{{/* Load footer block */}}
{{ $footer_section_name := site.Params.footer.block | default "minimal" }}
{{ $footer_section_path := printf "components/footers/%s.html" $footer_section_name }}
{{ if not (templates.Exists (printf "partials/%s" $footer_section_path)) }}
{{ if not (templates.Exists (printf "_partials/%s" $footer_section_path)) }}
{{ errorf "Check your `params.yaml`. Cannot find footer block at `layouts/partials/%s`" $footer_section_path }}
{{ end }}
{{ partial $footer_section_path . }}
@@ -215,7 +215,7 @@
{{/* EXTENSIBILITY HOOK: HEAD-END */}}
{{/* Deprecated custom_head hook */}}
{{ if templates.Exists "partials/custom_head.html" }}
{{ if templates.Exists "_partials/custom_head.html" }}
{{ partial "custom_head" . }}
{{ end }}
{{ partial "blox-core/functions/get_hook" (dict "hook" "head-end" "context" .) }}
@@ -267,7 +267,7 @@
{{/* EXTENSIBILITY HOOK: BODY-END */}}
{{/* Deprecated custom_js hook */}}
{{ if templates.Exists "partials/custom_js.html" }}
{{ if templates.Exists "_partials/custom_js.html" }}
{{ partial "custom_js" . }}
{{ end }}
{{ partial "blox-core/functions/get_hook" (dict "hook" "body-end" "context" .) }}
Loaded 100 of 266 files, more files were not shown because too many files have changed in this diff. Show more