[SOLVED] Shortcode page params


I try to get a page parameter with a key index within a shortcode. My shortcode:

<span class="foo">{{- index .Page.Params.mysection ( .Get 0 ) -}}</span>

within my config.yml I have got

                 bar: "a long text"

within my markdown file I call the shortcode with

{{< myshortcode bar >}}

I expected in my HTML document, but I don’t get it

<span class="foo">a long text</span>

How can I run it in a correct way?

Try $.Page.Params

With this I get the error

executing shortcode at <index $.Page.Params....>: error calling index: index of untyped nil

It looks like you’re trying to access your site-level configuration. You’ll need to use .Site.Params for that. Lemme know if that doesn’t work.

Thanks for this hint, it works with