diff --git a/src/exporter/pages.ts b/src/exporter/pages.ts index 0e00bc4..c767d17 100644 --- a/src/exporter/pages.ts +++ b/src/exporter/pages.ts @@ -170,6 +170,11 @@ export class PageHandler { savePage(article: Article): void { const path = article.slug.toString().split('/').slice(0, -1).join('/'); + article.file = article.file.replaceAll('../', ''); + if (article.file[0] === '/') { + article.file = article.file.slice(1); + } + // Writing JSON meta to file console.log('public/ajax/article/' + path); fs.mkdirSync('public/ajax/article/' + path, { recursive: true }); diff --git a/static/resources/js/navigation.js b/static/resources/js/navigation.js index 770aa99..0b511e7 100644 --- a/static/resources/js/navigation.js +++ b/static/resources/js/navigation.js @@ -150,7 +150,7 @@ async function navigate(slug, replace = false, loadData = true) { if (loadData || data.file) { document.querySelector('.edit a').href = `https://github.com/StrataSource/Wiki/edit/main/${ - data.file ? data.file.slice(3) : '404.md' + data.file || '404.md' }`; }