From 28b4772bb2251c66636e832145119296531092e1 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 4 Jan 2024 10:22:05 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20wiki=E2=80=99s=20bugs=20#341?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layout/_partial/main/navbar/breadcrumb.ejs | 2 +- scripts/events/lib/doc_tree.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/layout/_partial/main/navbar/breadcrumb.ejs b/layout/_partial/main/navbar/breadcrumb.ejs index d4c4751..8a50c34 100644 --- a/layout/_partial/main/navbar/breadcrumb.ejs +++ b/layout/_partial/main/navbar/breadcrumb.ejs @@ -84,7 +84,7 @@ function layoutDiv() { el += ''; el += ''; - let repo = page.repo || proj.repo + const repo = page.repo || proj?.repo if (repo) { el += `
diff --git a/scripts/events/lib/doc_tree.js b/scripts/events/lib/doc_tree.js index 53e09ba..c95b113 100644 --- a/scripts/events/lib/doc_tree.js +++ b/scripts/events/lib/doc_tree.js @@ -59,7 +59,7 @@ module.exports = ctx => { const wiki_pages = pages.filter(p => (p.layout === 'wiki')).map(p => new WikiPage(p)) const wiki_list = Object.keys(wiki.tree) // 上架的项目列表 - wiki.shelf = ctx.locals.get('data').wiki + wiki.shelf = ctx.locals.get('data').wiki || [] // 数据整合:项目标签 var all_tag_name = [] @@ -202,7 +202,6 @@ module.exports = ctx => { wiki.all_tags = all_tags wiki.all_pages = wiki_pages - wiki.shelf = ctx.locals.get('data').wiki ctx.theme.config.wiki = wiki }