topics: hugo (tidbit)

Archetypes in Hugo

Archetypes are front-matter templates useful for prepopulating new content.

When creating content via the cli, e.g:

hugo new tidbits/

A ‘tidbits’ type is inferred from the directory structure and an attempt is made to resolve an archetype template.

By default Hugo will first check for archtypes/, then archtypes/ and finally the corresponding locations relative to the active theme.

Templating functionality may be utilised in the Archetype.

For example, to prepopulate the date:

date: {{ .Date }}

Taxonomy Archetypes

A taxonomy type page may have properties associated via a file. For a topic ‘hugo’ the file path is: content/topics/hugo/

These files can be created using an Archetype by the Hugo new command when provided with a --kind flag.


hugo new --kind topics topics/hugo/

This results in a new content/topics/hugo/ file pre-populated using the topics Archetype.