[SOLVED] Adding Comments to archetype's Front Matter

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

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? :slight_smile:

Damn… It didn’t work for me… Let me check what I may have done wrong.

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.

@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!