Fix header linking issues

This commit is contained in:
Ole Eskild Steensen 2023-10-18 15:39:33 +02:00
parent b3964c060c
commit ecca0eddae

View File

@ -49,9 +49,9 @@ function getAnchorAttributes(filePath, linkTitle) {
let deadLink = false;
try {
const startPath = "./src/site/notes/";
const fullPath = filePath.endsWith(".md")
? `${startPath}${filePath}`
: `${startPath}${filePath}.md`;
const fullPath = fileName.endsWith(".md")
? `${startPath}${fileName}`
: `${startPath}${fileName}.md`;
const file = fs.readFileSync(fullPath, "utf8");
const frontMatter = matter(file);
if (frontMatter.data.permalink) {