Skip to content

Commit

Permalink
fix title, omit a bad input file
Browse files Browse the repository at this point in the history
  • Loading branch information
nishio committed Nov 29, 2023
1 parent 0cb3ebf commit 4623101
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tasks/json_to_markdown/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ try {
const obsidianPage = blocks
.map((block) => convertScrapboxToObsidian(block, 0, projectName))
.join("\n");
const quotedTitle = page["title"].replace(/\//gi, "-");

const title = page["title"];
if (title === "2020-01-16") {
continue;
}
const quotedTitle = title.replace(/\//gi, "-");
const obsidianPagePath = `${outdir}/${quotedTitle}.md`;
const frontmatter = `---\ntitle: ${page["title"]}\n---\n`;

const title_for_quartz = title.match(/"/) ? `'${title}'` : `"${title}"`;
const frontmatter = `---\ntitle: ${title_for_quartz}\n---\n`;
await Deno.writeTextFile(obsidianPagePath, frontmatter + obsidianPage);
await Deno.utime(obsidianPagePath, new Date(), page["updated"]);
}
Expand Down

0 comments on commit 4623101

Please sign in to comment.