Skip to content

"Trigger Templater on new file creation" template rendering fails when template only has frontmatter #1655

@muya

Description

@muya

Plugin information (please complete the following information):

  • OS: macOS 26.0.1
  • Templater version: 2.16.2
  • Obsidian version: v1.9.14
  • Templater settings:
    • Trigger Templater on new file creation: "On"

Describe the bug

Given this template:

---
tags: 
- my-tag
- wk-<% tp.date.now("YYYY-WW") %>
created_on: '<% tp.file.creation_date("YYYY-MM-DD HH:mm:ss Z") %>'
---

And we've set it as the Daily note "Template file location"

When the daily note gets created, the content from tp.* doesn't get rendered.

If the template has additional content, e.g.

---
tags: 
- my-tag
- wk-<% tp.date.now("YYYY-WW") %>
created_on: '<% tp.file.creation_date("YYYY-MM-DD HH:mm:ss Z") %>'
---

This is some extra content

It renders correctly.

Expected behavior

Actual Result
---
tags: 
- my-tag
- wk-<% tp.date.now("YYYY-WW") %>
created_on: '<% tp.file.creation_date("YYYY-MM-DD HH:mm:ss Z") %>'
---
Expected
---
tags: 
- my-tag
- wk-2025-43
created_on: '2025-10-25 09:01:23 +03:00'
---

Screenshots

screenshot-20251022_060805.mp4

Additional context

Discussed on Discord and issue confirmed: https://discord.com/channels/686053708261228577/1175184210609328229/1431271882094805012

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions