diff --git a/layout/_layout.pug b/layout/_layout.pug index 33a79278ceee3ffced9e3b18d5269b8057775bc4..1d0481927fa45f71462823eaee6c67f5be0d8441 100644 --- a/layout/_layout.pug +++ b/layout/_layout.pug @@ -10,7 +10,7 @@ doctype html html(lang=config.language) head - != partial('./_partials/head/head.pug', null, { cache: theme.cache }) + include ./_partials/head/head.pug body div#container.container header#header.header diff --git a/layout/_partials/head/head.pug b/layout/_partials/head/head.pug index 039f50f436684bae4d63aa902abf58c752ff7dee..33c89586e6ebf53834cf30aef7fcb4122472dfa8 100644 --- a/layout/_partials/head/head.pug +++ b/layout/_partials/head/head.pug @@ -1,21 +1,30 @@ - - var title = __('title') !== 'title' ? __('title') : config.title - var subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle - var author = __('author') !== 'author' ? __('author') : config.author - var description = __('description') !== 'description' ? __('description') : config.description - var keywords = config.author + ', ' + config.title - var title_suffix = ' | ' + title + var title = __('title') !== 'title' ? __('title') : config.title; + var subtitle = __('subtitle') !== 'subtitle' ? __('subtitle') : config.subtitle; + var author = __('author') !== 'author' ? __('author') : config.author; + var description = __('description') !== 'description' ? __('description') : config.description; + var keywords = config.author + ', ' + config.title; + var title_suffix = ' | ' + title; - if (is_home()) title = title + (theme.index_subtitle ? ' | ' + subtitle : '') - else if (is_archive()) title = __('title.archive') + title_suffix - else if (is_category()) title = __('title.category') + ': ' + page.category + title_suffix - else if (is_tag()) title = __('title.tag') + ': ' + page.tag + title_suffix - else if (is_post()) title = page.title + title_suffix - else if (is_page()) - 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 - else title = page.title + title_suffix + if (is_home()) { + title = title + ((theme.index_subtitle && subtitle) ? (' | ' + subtitle) : ''); + } else if (is_archive()) { + title = __('title.archive') + title_suffix; + } else if (is_category()) { + title = __('title.category') + ': ' + page.category + title_suffix; + } else if (is_tag()) { + title = __('title.tag') + ': ' + page.tag + title_suffix; + } else if (is_post()) { + 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(http-equiv="X-UA-Compatible" content="IE=edge")