hugo/content/release-notes/0.24-relnotes.md
Bjørn Erik Pedersen dd78d5b23f Squashed 'docs/' content from commit 5d9a6703
git-subtree-dir: docs
git-subtree-split: 5d9a6703591c29283800d7b9e4c5c85981ed86d6
2017-06-26 20:46:06 +02:00

4 KiB


date: 2017-06-21 title: 0.24

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.

Enhancements

Fixes