diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 164bb9c..6cbe841 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -2,8 +2,8 @@ function generate_title() { if (page.layout == 'wiki' && page.wiki && (page.title || page.seo_title)) { return page.wiki + __('symbol.colon') + (page.seo_title || page.title) + ' - ' + config.title; - } else if (page.seo_title || page.title || page.wiki || page.layout) { - return (page.seo_title || page.title || page.wiki || page.layout) + ' - ' + config.title; + } else if (page.seo_title || page.title || page.wiki) { + return (page.seo_title || page.title || page.wiki) + ' - ' + config.title; } else if (page.category) { return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title; } else if (page.tag) { @@ -80,7 +80,7 @@ function og_args() { <% if (config.favicon) { %> <%- favicon_tag(config.favicon) %> <% } %> - + <% if (config.inject && config.inject.head){ %> <% (config.inject.head||[]).forEach(function(item){ %> <%- item %> diff --git a/layout/_partial/main/article/read_next.ejs b/layout/_partial/main/article/read_next.ejs index 523685a..0855438 100644 --- a/layout/_partial/main/article/read_next.ejs +++ b/layout/_partial/main/article/read_next.ejs @@ -10,30 +10,22 @@ function layoutDiv() { title_prev = __('meta.newer'); title_next = __('meta.older'); } else if (page.layout === 'wiki' && page.wiki && page.wiki.length > 0) { - var wikis = []; - wikis = site.pages.filter(function (p) { - if (p.layout === 'wiki' && p.wiki && p.wiki === page.wiki) { - if (p.order === undefined) { - p.order = 0; + let proj = theme.wiki.projects[page.wiki]; + if (proj) { + proj.pages.forEach((p, i) => { + if (p.order < page.order) { + if (prev == undefined || p.order > prev.order) { + prev = p; + } + } else if (p.order > page.order) { + if (next == undefined || p.order < next.order) { + next = p; + } } - return true; - } else { - return false; - } - }).sort('order'); - page.order = page.order || 0; - wikis.forEach((p, i) => { - if (p.order < page.order) { - if (prev === undefined || p.order > prev.order) { - prev = p; - } - } else if (p.order > page.order) { - if (next === undefined || p.order < next.order) { - next = p; - } - } - }); - if (next === undefined) { + }); + } + if (next == undefined) { + // 项目的最后一篇文档 return '
'; } } diff --git a/layout/_partial/main/article/wiki_cover.ejs b/layout/_partial/main/article/wiki_cover.ejs index 4b81566..a4c30bc 100644 --- a/layout/_partial/main/article/wiki_cover.ejs +++ b/layout/_partial/main/article/wiki_cover.ejs @@ -5,13 +5,13 @@ function layoutWikiCover() { return el; } let proj = theme.wiki.projects[page.wiki]; - if (proj === undefined) { + if (proj == undefined) { return el; } - if (proj.path !== page.path) { + if (proj.homepage.path !== page.path) { return; } - if (proj.cover === undefined || proj.cover === false || proj.cover === '[]') { + if (proj.cover == undefined || proj.cover === false || proj.cover === '[]') { return el; } var cover = proj.cover; @@ -42,7 +42,7 @@ function layoutWikiCover() { el += '
' + desc + '
'; } el += '
'; - el += '' + __('btn.getting_started') + ''; + el += '' + (proj.start || __('btn.getting_started')) + ''; el += '
'; el += ''; el += ''; diff --git a/layout/_partial/main/navbar/breadcrumb.ejs b/layout/_partial/main/navbar/breadcrumb.ejs index 4daaa9f..88ca063 100644 --- a/layout/_partial/main/navbar/breadcrumb.ejs +++ b/layout/_partial/main/navbar/breadcrumb.ejs @@ -4,13 +4,13 @@ function layoutDiv() { if (page.breadcrumb === false) { return el; } - el += '
'; if (page.layout === "post") { var firstCat = ""; if (page.categories && page.categories.length > 0) { firstCat = page.categories.data[0].name; } - el += '