Skip to content

@bep bep released this Jun 21, 2017 · 1453 commits to master since this release

This is The Revival of the Archetypes!

"A feature that could be the name of the next Indiana Jones movie deserves its own release," says @bep.

Hugo now handles the archetype files as Go templates. This means that the issues with sorting and lost comments are long gone. This also means that you will have to supply all values, including title and date. But this also opens up a lot of new windows.

A fictional example for the section newsletter and the archetype file archetypes/newsletter.md:

---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
draft: true
---

**Insert Lead paragraph here.**

<!--more-->

## New Cool Posts

{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
* {{ .Title }}
{{ end }}

And then create a new post with:

hugo new newsletter/the-latest-cool.stuff.md

Note: the site will only be built if the .Site is in use in the archetype file, and this can be time consuming for big sites.

Hot Tip: If you set the newContentEditor configuration variable to an editor on your PATH, the newly created article will be opened.

The above newsletter type archetype illustrates the possibilities: The full Hugo .Site and all of Hugo's template funcs can be used in the archetype file.

Also, Hugo now supports archetype files for all content formats, not just markdown.

Hugo now has:

Notes

  • Archetype files now need to be complete, including title and date.
  • The -f (format) flag in hugo new is removed: Now use the archetype files as is.

Enhancements

Fixes


Automated with @goreleaser
Built with go version go1.8.3 darwin/amd64

Assets 24
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.