Files
bobatheme/layouts/_shortcodes/include.html
BBaoVanC 67ac36e9e2 Use resources to power the include shortcode
https://github.com/gohugoio/hugo/issues/13823#issuecomment-3015270202

Then I can just create unrendered pages for snippets. It fixes all the
markdown rendering related woes.
2025-06-29 03:41:37 -05:00

15 lines
582 B
HTML

{{/* https://github.com/gohugoio/hugo/issues/13823#issuecomment-3015270202 */}}
{{ with .Get 0 }}
{{ with $.Page.GetPage . }}
{{- .RenderShortcodes }}
{{ else with $.Page.Resources.Get . }}
{{- .RenderShortcodes }}
{{ else with resources.Get . }}
{{- .Content }}
{{ else }}
{{ errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
{{ end }}
{{ else }}
{{ errorf "The %q shortcode requires a positional parameter indicating the logical path of the file to include. See %s" .Name .Position }}
{{ end }}