Fix titles
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 28s

This commit is contained in:
thepaperpilot 2024-06-02 00:29:13 -05:00
parent c8f0bc1d7b
commit db58828d3f

View file

@ -118,7 +118,7 @@ function toSlug(string) {
// Add title to the top
data = data.replaceAll(
/---\n\n/gm,
`---\n# ${title}\n\n`);
`---\n# ${data.match(/title: "(.+)"/)[1]}\n\n`);
const fd = fs.openSync(filePath, "w+");
fs.writeSync(fd, data);