Frontmatter
Each content file
, ie an index.md for a leaf or _index.md for a branch, has what Hugo calls front matter, id metadata that spits these files into a head and body section.
The default skeleton archetypes/default.md
is
+++
date = '{{ .Date }}'
draft = true
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
+++
While the skeleton uses toml, it can be yaml or json, which I find simplest.
{
"date": "{{ .Date }}",
"draft": true,
"title": "{{ replace .File.ContentBaseName "-" " " | title }}"
}
Setting draft to true by default tripped me up, and I’m sure most other novices since that means your page doesn’t get rendered by default.