Logic in markdown?

Okay it works for me now. What Hugo version are you using?

v0.55.6

Cloned your repo and ran the site locally. When navigating to http://localhost:1313/test/ I only see:

My bad, I had changed the data structure. Iā€™ve updated the shortcodes and they display now.

Could it be this: https://github.com/gohugoio/hugo/issues/5827 ?

Adding

{ $_hugo_config := ``{ "version": 1 }`` }}

(not with double backticks but I canā€™t post them here otherwise)

did solve the problem. Is this to be expected? Is this use of _hugo_config a hack thatā€™s going to be deprecated at some point?

See the Shortcodes Revised section at https://github.com/gohugoio/hugo/releases/tag/v0.55.0 for more info.

I see, but I havenā€™t been able to make stuff turn up in the TOC with the {{< ā€¦ >}} format where I had h2, h3, etc in the partial.

I see. If using the version 1 config is working for you, I would roll with that.

Thatā€™s what Iā€™m doing currently, but Iā€™m worried about whether I should rely on this going forward. Should I expect h2 etc from a partial to show up in the TOC as ## does for markdown? Should I report this as a bug?

Iā€™m not sure in your particular case, but hereā€™s how Iā€™ve done it in the past.

Given shortcode usage like:

{{% test %}}
## Some heading
Some content
{{% /test %}}

And a shortcode definition like:

{{ .Inner }}

Then ## Some heading will show up in the ToC when {{ .TableOfContents }} is used.

My shortcode needs to generate content from a data file ā€“ I am currently using markdown, but for more complex compositions itā€™d be nice to be able to use HTML or ACE.