Skip to content

Commit

Permalink
Fix backlinks for pages in nested folders
Browse files Browse the repository at this point in the history
Resolves #41 

Backlinks don't work for pages in nested folders inside of `/notes`. I don't know if there's a better way to get the `/notes/` prefix without hard-coding it like this, but aside from that it's a pretty simple fix.
  • Loading branch information
atuttle authored and binyamin committed Sep 14, 2021
1 parent ef6a26a commit 434f26c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notes/notes.11tydata.js
Expand Up @@ -14,7 +14,7 @@ module.exports = {
title: data => titleCase(data.title || data.page.fileSlug),
backlinks: (data) => {
const notes = data.collections.notes;
const currentFileSlug = data.page.fileSlug;
const currentFileSlug = data.page.filePathStem.replace('/notes/', '');

let backlinks = [];

Expand Down Expand Up @@ -49,4 +49,4 @@ module.exports = {
return backlinks;
}
}
}
}

0 comments on commit 434f26c

Please sign in to comment.