I’m using a shortcode to call a snippet of markdown text (300-odd lines).
As recommended by @jmooring in the post No TableOfContents when reusing content, the shortcode which calls the snippet is
{{ $src := "" }}
{{- if .IsNamedParams -}}
{{- $src = .Get "src" -}}
{{- else -}}
{{- $src = .Get 0 -}}
{{- end -}}
{{- with .Site.GetPage $src -}}
{{- .RawContent -}}
{{- else -}}
{{- errorf "Can't find snippet reference %q in topic %s." (.Get 0) .Position -}}
{{- end -}}
and I’m calling the shortcode with {{% snippet src="/snippets/mytopic/index.md" %}}
This renders my minitoc on the right - Hugo is parsing the headings in my snippet.
But none of the shortcodes inside the snippet are rendering. For example, I’ve got a simple shortcode which creates an aside for a block of text:
{{- $_hugo_config := `{ "version": 1 }` -}}
{{- $color := "secondary" -}}
<div class="alert alert-{{ $color }}" role="alert">
<h4 class="alert-heading">Note</h4>
{{ .Inner | markdownify }}
</div>
In the snippet, I call this with:
{{< note >}}
This is my note
{{< /note >}}
But in the rendered site, these shortcodes aren’t rendered.I’m guessing it’s because I’m using % % instead of < >
Am I stuck between rendered shortcodes and no minitoc or no shortcodes and a minitoc?