---
categories: [Interview, News]
tags: [Events, Food, Hockey]
---
I have a markdown file with front matter like so. What I would like to do is be able to pass in a front matter parameter directly into the shortcode.
{{< shortcode list=tags >}}
or {{< shortcode list=categories >}}
Is there a way to directly pass front matter into shortcodes like so?
1 Like
bep
2
I would just do it the other way around, read the params from the shortcode:
{{ .Page.Params.myParam }}
If you want some dynamics to this, just pass the name of the param as a shortcode parameter, then:
{{ index .Page.Params (.Get "some-shortcode-param" ) }}
Or something.
4 Likes
Ohhh that is beautiful. Thank you, I did not consider that as an option.
pointyfar
Split this topic
4