From 0295ff43461f936f1b79ec0a903983fe9de57dbf Mon Sep 17 00:00:00 2001 From: "Michael J. Pedersen" Date: Fri, 20 Jan 2023 09:57:34 -0500 Subject: [PATCH] Update how tags are formatted so that Obsidian will work with them correctly. --- loremnotes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loremnotes.ts b/loremnotes.ts index 0d92387..9c5c0b4 100644 --- a/loremnotes.ts +++ b/loremnotes.ts @@ -52,7 +52,7 @@ function newFrontMatter({ } // generate tags here const numTags = randomInt(minTags, maxTags); - const chosenTags = randomSubset(tags, numTags).join(',') + const chosenTags = randomSubset(tags, numTags).join('"\n - "'); const status = randomChoice(["Backlog", "In progress", "Done"]); const published = randomChoice([0, 1]); const weight = randomInt(1, 100); @@ -60,7 +60,7 @@ function newFrontMatter({ const end = new Date(start.getTime() + 31536000000); // magic number, milliseconds in a year const duedate = randomDateInRange(start, end); - return `---\ntags: ${chosenTags}\ncssclass: ${cssclass}\n` + return `---\ntags: \n - "${chosenTags}"\ncssclass: ${cssclass}\n` + `aliases: ${alias}\npublish: ${publish}\n` + `status: ${status}\npublished: ${published}\n` + `due: ${duedate.toISOString().substring(0, 10)}\n`