I have search the Tubes, and the community here, but haven’t found what I am looking for. I tried several things, but they do not work. What I am trying to do is get values from the frontmatter, and do things depending of their values.
For example, using his simple frontmatter:
---
title: “Test”
type: audio
---
I would like to use a logic on my template along these lines:
{{ if .Params.type "audio" }}
<span>Audio</span>
{{ else if .Params.type "url" }}
<span>URL</span>
{{ else if .Params.type "video" }}
<span>Video</span>
{{ else }}
<span>Note</span>
{{ end }}
I recommend NOT using the parameter name “type”,
Every page has an attribute / value with the name “.Type”
This can lead to error with incorrect templates / spelling errors etc.
Better to use Params.mediatype.