31 lines
776 B
Markdown
31 lines
776 B
Markdown
<%*
|
|
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:
|
|
---
|