Shortcode ignores shortcode in text string

Shortcodes don’t seem to render shortcode values passed in as parameters:

I have a shortcode a.html:

{{ .Get "title" | markdownify }}

I call it with:

{{% a title="{{< logo >}}" %}}

The shortcode {{< logo >}} renders my SVG logo everywhere else, but in the a shortcode it just renders the literal text {{< logo >}}.

If I indirect into a partial (so have a call a-partial, say), I can render the value there using | markdownify and it works fine.

Is this a known limitation? Is there a nicer way to do this? I am starting to get ‘doubles’ of shortcode/partial pairs just so I can render my logo in shortcodes.

1 Like

Yes. You may not use a shortcode call as a shortcode argument. Shortcode arguments must be scalar values.

If you need to do the same thing in both a shortcode and a partial template, it’s fairly common to first create the partial template, then call the partial template from the shortcode.

1 Like