Hello, I’m trying to get the variable from frontmatter through shortcode and range it inside the shortcode to show it on the markdown file.
Frontmatter -
---
code_snippet_1:
- language: Python
modes:
- name: API Mode
content: api mode content code
- name: Proxy Mode
content: proxy mode content code
- language: Node Js
modes:
- name: API Mode
content: api mode content code
- name: Proxy Mode
content: proxy mode content code
---
My Shortcode -
{{< code-snippet "code_snippet_1" >}}
My Shortcode content -
{{ $snip := (.Get 0)}}
{{ range (index .Page.Params $snip) }}
{{ .language }}
{{ end }}
I don’t seem to understand the issue if anybody can help. I know ranging with $ is not possible.
Thanks.