template-obsidian-vault/_templates/Basic Note.md

31 lines
590 B
Markdown
Raw Normal View History

2024-10-02 18:57:21 +00:00
<%*
let filename = tp.file.title
if ( filename.startsWith("Untitled") ) {
filename = await tp.system.prompt("File name:", tp.date.now("YYYY-MM-DD-HHmm"))
await tp.file.rename(filename)
}
%>---
created_ts: <% tp.date.now("YYYY-MM-DD HH:mm") %>
source: <% await tp.system.prompt("Source") %>
tags:
<%*
let isAddingTags = true;
while (isAddingTags) {
const userTag = await tp.system.prompt("Enter a tag. Leave blank to complete.");
if (userTag) {
-%>
- <% userTag %>
<%*
} else {
isAddingTags = false;
}
}
-%>
---
```table-of-contents
title: **Table of Contents**
```
---