Frontmatter to pages created from template

I have a template that is more or less working as I want it, but I’d like to write into frontmatter so the page has an attribute written which is the date of page creation. The problem I’m having is when the template creates the page, it doesn’t close the frontmatter section out (resulting in the whole page detecting as frontmatter, until I manually hit enter before the ---

Here is my template’s frontmatter:

---
tags: template
description: Daily Work Notes
hooks.newPage:
  suggestedName: "*work/journal/{{today}}"
  confirmName: true
  openIfExists: true
  forPrefix: "*work/journal/"
  tags: #workjournal
  command: "New Work Note"
  key: "Alt-Shift-p"
frontmatter: 
  created:{{today}}
---

And a paste of how the page renders from that template:

---
created:2024-10-25---
```template
[[*work/journal/2024-10-24|<<]] [[*work/journal/2024-10-26]] [[*work/journal/2024-10-27|>>]] 

# Notes

___
# To-Do

- [ ]  📅2024-10-26

---

I see the problem is the frontmatter gets inserted into the new page, but there isn’t a after the line created:2024-10-25 before the --- right after it. How does one do that?

You need a space between the attributes and the value. You will also need to have quotation marks on the {{today}} part or it will fail to render it as the date.


frontmatter:
  created: "{{today}}"

Note that there is already a hidden created attribute that you can query. You don’t necessarily need to add it yourself.