Initial commit
This commit is contained in:
30
Templates/Journal Template.md
Normal file
30
Templates/Journal Template.md
Normal file
@@ -0,0 +1,30 @@
|
||||
<%*
|
||||
const fm = tp.frontmatter;
|
||||
const created = fm.created || tp.file.creation_date("YYYY-MM-DD[T]HH:mm:ss");
|
||||
const date = fm.date || String(created).substring(0,10);
|
||||
let createdTime = String(created).substring(11,16);
|
||||
let createdDate = String(created).substring(0,10);
|
||||
let title = fm.title;
|
||||
|
||||
if (!title){
|
||||
// title = await tp.system.prompt("Enter title") <--- removed, as it was hindering the thought getting out and into a note
|
||||
title = "";
|
||||
}
|
||||
else{
|
||||
title = " " + fm.title
|
||||
}
|
||||
|
||||
// Rename the file using the extracted date + current title
|
||||
let HHmm = createdTime.replace(/:/g, "").substring(0, 4);
|
||||
await tp.file.rename(`${createdDate} ${HHmm}${title}`);
|
||||
-%>
|
||||
---
|
||||
category:
|
||||
- "[[Journal]]"
|
||||
type:
|
||||
- "[[Log]]"
|
||||
title: <% title %>
|
||||
created: <% created %>
|
||||
date: <% date %>
|
||||
tags:
|
||||
---
|
||||
Reference in New Issue
Block a user