@@ -2,6 +2,8 @@ nav: | |||
home: Home | |||
about: About | |||
articles: Writing | |||
tag: Tag | |||
category: Category | |||
projects: Projects | |||
search: Search | |||
@@ -1,13 +1,3 @@ | |||
<% | |||
var title = page.title ? page.title : config.title; | |||
if (page.category) title = page.category; | |||
if (page.tag) title = page.tag; | |||
if (page.archive){ | |||
if (page.year) title = page.year + (page.month ? '/' + page.month : ''); | |||
else title = __('Writing'); | |||
} | |||
%> | |||
<head> | |||
<!-- so meta --> | |||
<meta charset="utf-8"> | |||
@@ -46,7 +36,7 @@ if (page.archive){ | |||
<% } %> | |||
<% } %> | |||
<!-- title --> | |||
<title><%= title %></title> | |||
<title><%= page_title() %></title> | |||
<!-- styles --> | |||
<%- css('css/style') %> | |||
<!-- persian styles --> |
@@ -0,0 +1,25 @@ | |||
/** | |||
* Page Title Helper | |||
* @description Generate page title. | |||
* @example | |||
* <%- page_title() %> | |||
*/ | |||
hexo.extend.helper.register("page_title", function () { | |||
var title = this.page.title ? this.page.title : this.config.title; | |||
if (this.is_archive()) { | |||
title = this.__("nav.articles"); | |||
if (this.is_month()) { | |||
title += ": " + this.page.year + "/" + this.page.month; | |||
} else if (this.is_year()) { | |||
title += ": " + this.page.year; | |||
} | |||
} else if (this.is_category()) { | |||
title = this.__("nav.category") + ": " + this.page.category; | |||
} else if (this.is_tag()) { | |||
title = this.__("nav.tag") + ": " + this.page.tag; | |||
} | |||
return title; | |||
}); |