Foam Template Bug with Comments in Frontmatter

foam

Here is my Foam template frontmatter:

---
title: ${FOAM_TITLE}
created: "${FOAM_DATE_YEAR}-${FOAM_DATE_MONTH}-${FOAM_DATE_DATE}"
foam_template:
  name: Public Note Template
  description: Creates a new public note.
  # E.g. notes/2025/2025-05/some-public-note.md
  filepath: 'notes/${FOAM_DATE_YEAR}/${FOAM_DATE_YEAR}-${FOAM_DATE_MONTH}/${FOAM_SLUG}.md'
---

The note instantiated by the template has the following content:

---
title: <Title>
created: "2025-05-27"
  # E.g. notes/2025/2025-05/some-public-note.md
  filepath: 'notes/2025/2025-05/<Title>.md'
---

The issue is, when removing the foam_template part, ‘comments’ are not handled. The # line there cause the filepath to be kept. Then the ‘indentation’ of the frontmatter is messed up.

This could be a bug, or it is just because I didn’t use it correctly.