This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
mystic/themes/hueman/layout/common/content-title.ejs

40 lines
1.7 KiB
Plaintext
Raw Normal View History

2018-09-03 07:41:16 +00:00
<div class="main-body-header">
<h1 class="header">
<%
var title = page.title;
if (page.archive) {
title = __('index.archive');
if (page.month) {
title += ': ' + page.year + '/' + page.month;
} else if (page.year) {
title += ': ' + page.year;
}
title = '<i class="icon fa fa-archive"></i>' + title;
} else if (page.author && !is_post()) {
title = page.author.name;
if (page.author.about) {
title += ' - ' + page.author.about;
}
} else if (page.category) {
title = '<i class="icon fa fa-folder-open"></i>' + __('index.category') + ': <em class="page-title-link">' + page.category + '</em>';
} else if (page.tag) {
title = '<i class="icon fa fa-tag"></i>' + __('index.tag') + ': <em>' + page.tag + '</em>';
} else if (is_post()) {
title = list_categories(page.categories, {show_count: false, style: 'none', class: 'page-title', separator: '<i class="icon fa fa-angle-right"></i>'});
if (title == "") {
title = __('index.uncategorized');
}
} else if (is_home()) {
title = '<em class="page-title-link" data-url="home">' + __('index.home') + '</em>';
} else if (page.subtitle) {
title = '<em class="page-title-link" data-url="' + url_for(page.path) + '">' + page.subtitle + '</em>';
} else if (page.title) {
title = '<em class="page-title-link" data-url="' + url_for(page.path) + '">' + page.title + '</em>';
} else {
title = config.title;
}
%>
<%- title %>
</h1>
</div>