From 060cfcbbfe0f8680218a67e96ed86f92c4328e27 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 1 Jun 2024 23:54:40 -0500 Subject: [PATCH] Add title to each page --- build_garden.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_garden.js b/build_garden.js index 25fa0a8f..a0ccc55f 100644 --- a/build_garden.js +++ b/build_garden.js @@ -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);