Use a $.Site.Params as argument for a shortcode parameter

Hi there!

I’m using the Docsy-Theme that has some shortcodes, one of them is for outputting a nice visual block:

{{% blocks/feature url="https://someurl.com" %}}
Some Text
{{% /blocks/feature %}}

Now, as you can see, the shortcode has a url parameter. In that parameter, I want to insert something that I’ve defined in config.yaml: .Site.Params.project_links.myurl.

I’ve tried the following to make it work:

{{% blocks/feature url="{{< param "project_links.myurl" >}}" %}}
^ results in error during compilation

{{% blocks/feature url="{{ $.Site.Params.project_links.myurl }}" %}}
^ verbatim output of the given url text, so it rendered to href="{{ $.Site... }}"
^ also the same with any other argument, like .Site.Params, .Params, etc.

Within the blocks/feature shortcode, the code is like this:

{{ with .Get "url" }}<p><a href="{{ . }}">...</a>{{ end }}

Is it somehow possible to use the Docsy shortcode and feed it something I’ve defined in the config.yaml?

Thanks!

Questions about theme functionality are better asked in the correct place. Docsy has substantial documentation, a presence on StackOverflow and GithHub discussions! I’d suggest any of those is a better place to ask than here!

Shortcode arguments must be string, int, float, or bool. You cannot pass in code (including shortcodes) that require evaluation.

Just clone the theme’s shortcode, and modify it as needed.