<SOLVED> My Own Values in Archetypes

Hi all. I’m struggling a little with the archetypes in building an experimental site - I’m wanting to find out if I can have my own metadata in the front-matter and if I can, how do i call on the data?

I have a folder called “walks” and where I create content pages, I want some specific information such as “duration of the walk”, “best time of year”, “level of fitness” etc.

In archetypes I created a walks.md and had the following…

title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
duration: []
fitness: []
season: []

When I create the single layout page I was hoping to be able to simply call on what I needed, as an example…

<h1>{{ .Title }}</h1>
<h4>{{ .Date }}</h4>
<h4>{{ .Duration }}</h4>
<h4>{{ .fitness }}</h4>
<h4>{{ .Season }}</h4>

This clearly isn’t working (I didn’t really expect it to, nothing is that easy in life lol). I read through the documentation and through a few threads but I’m still confused a bit.

Can this be done and how?

Thank you

The answer was so simple - hope I haven’t wasted anyone’s time!

For future reference (to myself and anyone else),

<h4>{{ .Params.Duration }}</h4>
<h4>{{ .Params.Fitness }}</h4>
<h4>{{ .Params.Season }}</h4>

I have to say I’m loving Hugo - well done to all that created it and maintain it!

1 Like

gives you an array!

fitness: ["good", "very good"]

use

fitness : "good"

Yup, I realized that after, thanks for pointing it out though!