mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 04:35:20 +00:00
Fix header linking issues
This commit is contained in:
parent
b3964c060c
commit
ecca0eddae
@ -49,9 +49,9 @@ function getAnchorAttributes(filePath, linkTitle) {
|
|||||||
let deadLink = false;
|
let deadLink = false;
|
||||||
try {
|
try {
|
||||||
const startPath = "./src/site/notes/";
|
const startPath = "./src/site/notes/";
|
||||||
const fullPath = filePath.endsWith(".md")
|
const fullPath = fileName.endsWith(".md")
|
||||||
? `${startPath}${filePath}`
|
? `${startPath}${fileName}`
|
||||||
: `${startPath}${filePath}.md`;
|
: `${startPath}${fileName}.md`;
|
||||||
const file = fs.readFileSync(fullPath, "utf8");
|
const file = fs.readFileSync(fullPath, "utf8");
|
||||||
const frontMatter = matter(file);
|
const frontMatter = matter(file);
|
||||||
if (frontMatter.data.permalink) {
|
if (frontMatter.data.permalink) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user