fix title

This commit is contained in:
xaoxuu 2022-11-07 21:51:45 +08:00
parent c238e2b054
commit 6eb9a06f8d
5 changed files with 8 additions and 6 deletions

View File

@ -12,7 +12,9 @@ function generate_title() {
return wiki + ' - ' + config.title; return wiki + ' - ' + config.title;
} }
} else { } else {
if (page.category) { if (page.title) {
return page.title;
} else if (page.category) {
return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title; return __('btn.category') + __('symbol.colon') + page.category + ' - ' + config.title;
} else if (page.tag) { } else if (page.tag) {
return __('btn.tag') + __('symbol.colon') + page.tag + ' - ' + config.title; return __('btn.tag') + __('symbol.colon') + page.tag + ' - ' + config.title;

View File

@ -7,7 +7,7 @@ if (page.menu_id == undefined) {
<% if (page.posts && (is_category() || is_tag())) { %> <% if (page.posts && (is_category() || is_tag())) { %>
<%- partial('index') %> <%- partial('index') %>
<% } else { %> <% } else { %>
<% page.title = __('btn.archives'); %> <% page.title = __('btn.archives') + ' - ' + config.title; %>
<%- partial('_partial/main/navbar/list_post') %> <%- partial('_partial/main/navbar/list_post') %>
<div class='post-list'> <div class='post-list'>
<% var years = []; %> <% var years = []; %>

View File

@ -5,7 +5,7 @@ if (page.menu_id == undefined) {
} }
%> %>
<% if (site.categories.length) { %> <% if (site.categories.length) { %>
<% page.title = __('btn.categories'); %> <% page.title = __('btn.categories') + ' - ' + config.title; %>
<% page.layout = 'categories'; %> <% page.layout = 'categories'; %>
<%- partial('_partial/main/navbar/list_post') %> <%- partial('_partial/main/navbar/list_post') %>
<div class='post-list'> <div class='post-list'>

View File

@ -5,7 +5,7 @@ if (page.menu_id == undefined) {
} }
%> %>
<% if (site.tags.length) { %> <% if (site.tags.length) { %>
<% page.title = __('btn.tags'); %> <% page.title = __('btn.tags') + ' - ' + config.title; %>
<% page.layout = 'tags'; %> <% page.layout = 'tags'; %>
<%- partial('_partial/main/navbar/list_post') %> <%- partial('_partial/main/navbar/list_post') %>
<div class='post-list'> <div class='post-list'>

View File

@ -7,9 +7,9 @@ if (page.layout == undefined) {
} }
if (page.title == undefined) { if (page.title == undefined) {
if (page.tagName) { if (page.tagName) {
page.title = page.tagName; page.title = page.tagName + ' - ' + config.title;
} else { } else {
page.title = __('btn.wiki'); page.title = __('btn.wiki') + ' - ' + config.title;
} }
} }
function layoutTitle() { function layoutTitle() {