Hello. I need help. I have the section “career”. In this section I published the vacancies.
Each vacancy have parameters like: requirements, department and etc.
I want to insert each parameter in a variable and then use it in a template “list”.
For example, in the “list” template - {{ .department }}
How to do it?
I understand that I need to create the file careers.md in “themes/mytheme/archetypes/”.
file contents
+++
title = ""
description = ""
tags = []
department = ""
+++
And then in list.md insert the code {{ .department }}. But it is not working
Where are you placing this in your list template? Is this in a range or are you talking about accessing it in the section page itself, in which case you can create an _index.md at content/careers/_index.md that can contain both front matter and content.
If you have a bunch of markdown files at content/careers/*.md, maybe you are looking for something like this:
<!--.e.g, in layouts/section/careers.html-->
<ul class="careers">
{{ range .Data.Pages }}
<li class="career">{{ .Title }} | {{ .Params.department }}</li>
{{ end }}
</ul>
If you can provide more templating examples, maybe I can provide more assistance…