From 6eb9a06f8dbf47fb72ca3d212f9ca44423569d74 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Mon, 7 Nov 2022 21:51:45 +0800 Subject: [PATCH] fix title --- layout/_partial/head.ejs | 4 +++- layout/archive.ejs | 2 +- layout/categories.ejs | 2 +- layout/tags.ejs | 2 +- layout/wiki.ejs | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 5006947..61ef8cb 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -12,7 +12,9 @@ function generate_title() { return wiki + ' - ' + config.title; } } else { - if (page.category) { + if (page.title) { + return page.title; + } else if (page.category) { return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title; } else if (page.tag) { return __('btn.tag') + __('symbol.colon') + page.tag + ' - ' + config.title; diff --git a/layout/archive.ejs b/layout/archive.ejs index bdaeca1..c3818a3 100755 --- a/layout/archive.ejs +++ b/layout/archive.ejs @@ -7,7 +7,7 @@ if (page.menu_id == undefined) { <% if (page.posts && (is_category() || is_tag())) { %> <%- partial('index') %> <% } else { %> - <% page.title = __('btn.archives'); %> + <% page.title = __('btn.archives') + ' - ' + config.title; %> <%- partial('_partial/main/navbar/list_post') %>
<% var years = []; %> diff --git a/layout/categories.ejs b/layout/categories.ejs index 3b6dd7d..95781c0 100755 --- a/layout/categories.ejs +++ b/layout/categories.ejs @@ -5,7 +5,7 @@ if (page.menu_id == undefined) { } %> <% if (site.categories.length) { %> - <% page.title = __('btn.categories'); %> + <% page.title = __('btn.categories') + ' - ' + config.title; %> <% page.layout = 'categories'; %> <%- partial('_partial/main/navbar/list_post') %>
diff --git a/layout/tags.ejs b/layout/tags.ejs index 078d7e8..e911875 100755 --- a/layout/tags.ejs +++ b/layout/tags.ejs @@ -5,7 +5,7 @@ if (page.menu_id == undefined) { } %> <% if (site.tags.length) { %> - <% page.title = __('btn.tags'); %> + <% page.title = __('btn.tags') + ' - ' + config.title; %> <% page.layout = 'tags'; %> <%- partial('_partial/main/navbar/list_post') %>
diff --git a/layout/wiki.ejs b/layout/wiki.ejs index f0bb3f3..d726105 100755 --- a/layout/wiki.ejs +++ b/layout/wiki.ejs @@ -7,9 +7,9 @@ if (page.layout == undefined) { } if (page.title == undefined) { if (page.tagName) { - page.title = page.tagName; + page.title = page.tagName + ' - ' + config.title; } else { - page.title = __('btn.wiki'); + page.title = __('btn.wiki') + ' - ' + config.title; } } function layoutTitle() {