Archetypes
Archetypes is template for new content, located at ~/archetypes. A content file consists of frontmatter and markup. Frontmatter can be TOML, YAML, JSON.
~/archetypes/default.md is the default archetype. Hugo Narrow include two archetypes:
archetypes/default.md: default archetype, used forpostsand others.archetypes/projects.md: project archetype, used for project files.
Create a new post
Use the following command to create a new post named my-first-post with the default archetype:
hugo new content posts/my-first-post.mdCreate a new project
Use the following command to create a new project named my-first-project with the project archetype:
hugo new content projects/my-first-project.md
# use `--kind` parameter
hugo new content --kind projects projects/my-first-project.mdCustom archetypes
If you need create your own archetype, create a file at the root folder of the site: ~/archetypes/default.md
Hugo follows the lookup order for archetypes:
archetypes/posts.mdthemes/hugo-narrow/archetypes/posts.mdarchetypes/default.mdthemes/hugo-narrow/archetypes/default.md
If none of these exists, Hugo uses a built-in default archetype.
Note
See Hugo Documentation for more details.