Skip to content

Commit

Permalink
fix the page_nav function
Browse files Browse the repository at this point in the history
  • Loading branch information
mamboer committed Dec 16, 2015
1 parent f6aa74c commit 12e7d07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions scripts/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function startsWith(str, start){
hexo.extend.helper.register('page_nav', function(){
var type = this.page.canonical_path.split('/')[0];
var sidebar = this.site.data.sidebar[type];
var path = pathFn.basename(this.path);
var path = this.path.substr(this.path.indexOf(type+'/') + (type+'/').length);
var list = {};
var prefix = 'sidebar.' + type + '.';

Expand All @@ -30,12 +30,14 @@ hexo.extend.helper.register('page_nav', function(){
var result = '';

if (index > 0){
result += '<a href="' + keys[index - 1] + '" class="article-footer-prev" title="' + this.__(prefix + list[keys[index - 1]]) + '">' +
path = this.url_for_lang(type + '/' + keys[index-1]);
result += '<a href="' + path + '" class="article-footer-prev" title="' + this.__(prefix + list[keys[index - 1]]) + '">' +
'<i class="fa fa-chevron-left"></i><span>' + this.__('page.prev') + '</span></a>';
}

if (index < keys.length - 1){
result += '<a href="' + keys[index + 1] + '" class="article-footer-next" title="' + this.__(prefix + list[keys[index + 1]]) + '">' +
path = this.url_for_lang(type + '/' + keys[index+1]);
result += '<a href="' + path + '" class="article-footer-next" title="' + this.__(prefix + list[keys[index + 1]]) + '">' +
'<span>' + this.__('page.next') + '</span><i class="fa fa-chevron-right"></i></a>';
}

Expand Down
2 changes: 1 addition & 1 deletion themes/navy/source/css/_variables.styl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vendor-prefixes = webkit moz ms official
color-default = #444
color-gray = #999
color-border = #e3e3e3
color-navy = hsl(210, 25%, 12%)
color-navy = hsl(240, 14%, 16%)
color-link = #0e83cd
color-link-hover = lighten(color-link, 10%)

Expand Down

0 comments on commit 12e7d07

Please sign in to comment.