mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-07-24 11:00:31 +00:00
Fix #64: Support links ending in .md
Some dataview queries adds a .md file extension on links to other pages. This caused the digital garden to search for filename.md.md, which it didn't find. Thus dataview queries could result in dead links that weren't really dead. This commit should fix that.
This commit is contained in:
parent
3836163a2c
commit
825893d52c
@ -135,7 +135,11 @@ module.exports = function(eleventyConfig) {
|
||||
|
||||
|
||||
try {
|
||||
const file = fs.readFileSync(`./src/site/notes/${fileName}.md`, 'utf8');
|
||||
const startPath = './src/site/notes/';
|
||||
const fullPath = fileName.endsWith('.md') ?
|
||||
`${startPath}${fileName}`
|
||||
:`${startPath}${fileName}.md`;
|
||||
const file = fs.readFileSync(fullPath, 'utf8');
|
||||
const frontMatter = matter(file);
|
||||
if (frontMatter.data.permalink) {
|
||||
permalink = frontMatter.data.permalink;
|
||||
|
Loading…
x
Reference in New Issue
Block a user