If you in a "include" type of shortcode when using the {{% syntax to use it, indent the {{ $p.RenderShortcodes }} with 4 characters:
{{ $p.RenderShortcodes }}
You end up with a {{__hugo_ctx pid=3214}} similar code in the output.
Note that I would say that the above is (almost?) always a signal to fix/adjust your template, and I'm not sure how/what the fix would be.
Failing test:
func TestRenderShortcodesCodeBlock(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['section','rss','sitemap','taxonomy','term']
-- layouts/_shortcodes/foo.html --
{{ $p := site.GetPage "includeme" }}
{{ $p.RenderShortcodes }}
-- layouts/home.html --
{{ .Content }}
-- content/_index.md --
---
title: home
---
{{% foo %}}
-- content/includeme.md --
---
title: "includeme"
---
Some markdown.
`
b := Test(t, files)
b.AssertNoRenderShortcodesArtifacts()
}
If you in a "include" type of shortcode when using the
{{%syntax to use it, indent the{{ $p.RenderShortcodes }}with 4 characters:{{ $p.RenderShortcodes }}You end up with a
{{__hugo_ctx pid=3214}}similar code in the output.Note that I would say that the above is (almost?) always a signal to fix/adjust your template, and I'm not sure how/what the fix would be.
Failing test: