regis
February 13, 2018, 6:26pm
1
Anybody know a way to add comments to the archetype to communicate something to authors so they end up with something like:
---
title: "Bonjour2"
date: 2018-02-13T13:23:33-05:00
draft: true
# feature takes the url of the featured image.
# feature:
---
Thanks
maiki
February 13, 2018, 6:44pm
2
I just tested it, and comments are copied over. So, the following archetype:
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ dateFormat "2006-01-02" .Date }}
description: ""
draft: true
authors:
- "maiki"
tags:
- ""
# This is a comment
---
When used with hugo new test/comments.md
, creates:
---
title: "Comments"
date: 2018-02-13
description: ""
draft: true
authors:
- "maiki"
tags:
- ""
# This is a comment
---
I thought you might need to escape it in a template tag or something, such as the pipe example for IE tags .
Does that cover your question?
regis
February 13, 2018, 6:54pm
3
Damn… It didn’t work for me… Let me check what I may have done wrong.
bep
February 13, 2018, 6:59pm
4
This wasn’t possible pre Hugo 0.26 or something, but current Hugo versions does not try to parse the front matter – so comments will be preserved.
regis
February 13, 2018, 7:02pm
5
@maiki sorry I had you tested it, no problem with adding comments to them. My problem came from a defaut.md in the project archetypes which overrid the theme one.
@bep yes it works great!