feat: apply more Hugo breaking changes of /partials -> /_partials

For compatibility with Hugo ~v0.148
This commit is contained in:
George Cushen committed 2025-08-20 00:24:39 +01:00
1 parent 41f1f43aa4
commit 62f5b139d3
7 files changed
+7 -7

No files matched your search

@@ -12,7 +12,7 @@
{{ 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)) }}
{{ 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 }}
{{ 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 }}
{{/* Workaround to make Hugo's .Page.Store.Set cascade up to the parent of headless pages */}}
@@ -8,7 +8,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)) }}
{{ 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 }}
{{ 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 }}
{{/* Mermaid block: Workaround to make Hugo's .Page.Store.Set cascade up to the parent of headless pages */}}
@@ -6,7 +6,7 @@
{{ $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)) }}
{{ errorf "Check your `params.yaml`. Cannot find footer block at `layouts/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 . }}
+1 -1
View File
@@ -41,7 +41,7 @@
{{ $block_name := .Params.header.navbar.block | default site.Params.header.navbar.block | default "navbar" }}
{{ $block_path := printf "components/headers/%s.html" $block_name }}
{{ if not (templates.Exists (printf "_partials/%s" $block_path)) }}
{{ errorf "Check your `header` config in `params.yaml` and/or front matter. Cannot find header block at `layouts/partials/%s`" $block_path }}
{{ errorf "Check your `header` config in `params.yaml` and/or front matter. Cannot find header block at `layouts/_partials/%s`" $block_path }}
{{ end }}
{{ partial $block_path . }}
</div>
@@ -5,7 +5,7 @@
{{ $loaded := false }}
{{ $partial_dir := printf "hooks/%s/" .hook }}
{{ $context := .context }}
{{ $hook_dir_path := path.Join "layouts/_partials" $partial_dir }}
{{ $hook_dir_path := path.Join "layouts/_partialss" $partial_dir }}
{{ if fileExists $hook_dir_path }}
{{ range os.ReadDir $hook_dir_path }}
{{ if not .IsDir }}
+1 -1
View File
@@ -3,7 +3,7 @@ module:
- source: data
target: data
- source: functions
target: layouts/partials/mod-decap-cms
target: layouts/_partials/mod-decap-cms
- source: templates
target: layouts/decap_cms
outputFormats:
@@ -5,7 +5,7 @@
{{ $loaded := false }}
{{ $partial_dir := printf "hooks/%s/" .hook }}
{{ $context := .context }}
{{ $hook_dir_path := path.Join "layouts/partials" $partial_dir }}
{{ $hook_dir_path := path.Join "layouts/_partials" $partial_dir }}
{{ if fileExists $hook_dir_path }}
{{ range os.ReadDir $hook_dir_path }}
{{ if not .IsDir }}