提交 57ef4c31 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

fix: Solved the problem that the same title in different pages

上级 891b1b72
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
doctype html doctype html
html(lang=config.language) html(lang=config.language)
head head
!= partial('./_partials/head/head.pug', null, { cache: theme.cache }) include ./_partials/head/head.pug
body body
div#container.container div#container.container
header#header.header header#header.header
......
- -
var title = __('title') !== 'title' ? __('title') : config.title var title = __('title') !== 'title' ? __('title') : config.title;
var subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle var subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle;
var author = __('author') !== 'author' ? __('author') : config.author var author = __('author') !== 'author' ? __('author') : config.author;
var description = __('description') !== 'description' ? __('description') : config.description var description = __('description') !== 'description' ? __('description') : config.description;
var keywords = config.author + ', ' + config.title var keywords = config.author + ', ' + config.title;
var title_suffix = ' | ' + title var title_suffix = ' | ' + title;
if (is_home()) title = title + (theme.index_subtitle ? ' | ' + subtitle : '') if (is_home()) {
else if (is_archive()) title = __('title.archive') + title_suffix title = title + ((theme.index_subtitle && subtitle) ? (' | ' + subtitle) : '');
else if (is_category()) title = __('title.category') + ': ' + page.category + title_suffix } else if (is_archive()) {
else if (is_tag()) title = __('title.tag') + ': ' + page.tag + title_suffix title = __('title.archive') + title_suffix;
else if (is_post()) title = page.title + title_suffix } else if (is_category()) {
else if (is_page()) title = __('title.category') + ': ' + page.category + title_suffix;
if (page.type === 'tags') title = __('title.tag') + title_suffix } else if (is_tag()) {
else if (page.type === 'categories') title = __('title.category') + title_suffix title = __('title.tag') + ': ' + page.tag + title_suffix;
else title = page.title + title_suffix } else if (is_post()) {
else title = page.title + title_suffix title = page.title + title_suffix;
} else {
if (page.type === 'tags') {
title = __('title.tag') + title_suffix;
} else if (page.type === 'categories') {
title = __('title.category') + title_suffix;
} else {
title = page.title + title_suffix;
}
}
meta(charset="UTF-8") meta(charset="UTF-8")
meta(http-equiv="X-UA-Compatible" content="IE=edge") meta(http-equiv="X-UA-Compatible" content="IE=edge")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册