Add title to each page

This commit is contained in:
thepaperpilot 2024-06-01 23:54:40 -05:00
parent 71a0fe3493
commit 060cfcbbfe

View file

@ -115,6 +115,10 @@ function toSlug(string) {
/---\n\n/gm,
`---\n\n> Referenced by: ${referencedBy[title].map(tag => `[${tag}](${pageLinks[tag]})`).join(", ")}\n\n`);
}
// Add title to the top
data = data.replaceAll(
/---\n\n/gm,
`---\n# ${title}\n\n`);
const fd = fs.openSync(filePath, "w+");
fs.writeSync(fd, data);