Fix build errors

This commit is contained in:
Ole Eskild Steensen 2023-01-06 14:45:12 +01:00
parent 7939b70509
commit 2fe6657a92
4 changed files with 4 additions and 5 deletions

View File

@ -31,7 +31,7 @@ module.exports = async () => {
return orderedTree; return orderedTree;
} }
function getPermalinkAndName(path) { function getPermalinkAndName(path, key) {
let permalink = "/" let permalink = "/"
let name = key.replace(".md", ""); let name = key.replace(".md", "");
try { try {
@ -56,7 +56,7 @@ function populateWithPermalink(tree) {
const isNote = tree[key].path.endsWith(".md"); const isNote = tree[key].path.endsWith(".md");
tree[key].isNote = isNote; tree[key].isNote = isNote;
if (isNote) { if (isNote) {
let { permalink, name } = getPermalinkAndName(tree[key].path); let { permalink, name } = getPermalinkAndName(tree[key].path, key);
tree[key].permalink = permalink tree[key].permalink = permalink
tree[key].name = name tree[key].name = name
} }

View File

@ -1,5 +1,4 @@
--- ---
title: "/{% if title %}{{ title }}{% else %}{{ page.fileSlug }}{% endif %}/"
permalink: "notes/{{ page.fileSlug | slugify }}/" permalink: "notes/{{ page.fileSlug | slugify }}/"
--- ---
<!DOCTYPE html> <!DOCTYPE html>

View File

@ -33,7 +33,7 @@ module.exports = {
noteTitle: (data) => { noteTitle: (data) => {
const currentnote = data.collections.gardenEntry && data.collections.gardenEntry[0]; const currentnote = data.collections.gardenEntry && data.collections.gardenEntry[0];
if (currentnote && currentnote.data) { if (currentnote && currentnote.data) {
return currentNote.data.title || currentnote.data.page.fileSlug; return currentnote.data.title || currentnote.data.page.fileSlug;
} }
return ""; return "";
}, },

View File

@ -37,7 +37,7 @@ body {
padding: 10px; padding: 10px;
} }
div.translusion { div.transclusion {
border-left: 4px solid gray; border-left: 4px solid gray;
padding-left: 10px; padding-left: 10px;
position: relative; position: relative;