diff --git a/layout/_partial/main/article/read_next.ejs b/layout/_partial/main/article/read_next.ejs index 79a6124..b025379 100644 --- a/layout/_partial/main/article/read_next.ejs +++ b/layout/_partial/main/article/read_next.ejs @@ -12,8 +12,8 @@ function layoutDiv() { } else if (page.layout === 'wiki' && page.wiki && page.wiki.length > 0) { let proj = theme.wiki.tree[page.wiki]; if (proj) { - let ps = proj.pages.filter(p => p.path == page.path) - if (ps.length > 0) { + let ps = proj.pages?.filter(p => p.path == page.path) + if (ps?.length > 0) { const current_page_number = ps[0].page_number || 0; proj.pages.forEach((p, i) => { if (p.page_number < current_page_number) { diff --git a/layout/_partial/widgets/related.ejs b/layout/_partial/widgets/related.ejs index c87c7f3..ae247fe 100644 --- a/layout/_partial/widgets/related.ejs +++ b/layout/_partial/widgets/related.ejs @@ -9,7 +9,7 @@ function layoutDiv() { if (proj?.related?.length > 0) { proj.related.filter(pid => shelf.includes(pid)).forEach((pid, i) => { let p = tree[pid]; - if (p && p.title !== proj?.title) { + if (p && p.title !== proj?.title && p.homepage) { related.push(p); } }); @@ -25,10 +25,7 @@ function layoutDiv() { el += '' + __('meta.more', title) + ''; el += ''; el += ''; el += ''; }