You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shortcode currently looks for an index in .Site.Params but if the index is a map it cannot return a value from the map. If the user passes name="group.key" it should return the key value from the group map.
The following worked for me:
{{ $context := .context }}
{{ $paramNames := split .name "." }}
{{ with $context }}
{{ $params := .Site.Params }}
{{ range $paramName := $paramNames }}
{{ $params = index $params $paramName }}
{{ end }}
{{ markdownify $params }}
{{ end }}
worked for me. Though I had to use markdownify to get the text formatted as I wanted (my params has nested maps with markdown at the end) and the {{<>}} variant of the shortcode. It would be good to see the proper way to do what i surely butchered!
The shortcode currently looks for an index in
.Site.Params
but if the index is a map it cannot return a value from the map. If the user passesname="group.key"
it should return the key value from the group map.The following worked for me:
worked for me. Though I had to use
markdownify
to get the text formatted as I wanted (my params has nested maps with markdown at the end) and the{{<>}}
variant of the shortcode. It would be good to see the proper way to do what i surely butchered!https://github.com/McShelby/hugo-theme-relearn/blob/main/layouts/partials/shortcodes/siteparam.html
The text was updated successfully, but these errors were encountered: