Updated sidebar links to include root

This commit is contained in:
Jennifer Mann
2017-04-25 16:20:00 -04:00
parent f35f791964
commit 02ac63673b
4 changed files with 22 additions and 9 deletions
+3 -1
View File
@@ -58,7 +58,8 @@ hexo.extend.helper.register('doc_sidebar', function(className){
var itemClass = className + '-link'
if (link === path) itemClass += ' current'
result += '<a href="/' + href + '" class="' + itemClass + '">' + self.__(prefix + text) + '</a>'
result += `<a href="${self.config.root + href}" class="${itemClass}">
${self.__(prefix + text)}</a>`
})
})
@@ -83,6 +84,7 @@ hexo.extend.helper.register('header_menu', function(className){
hexo.extend.helper.register('canonical_url', function(lang){
var path = this.page.canonical_path
if (lang && lang !== 'en') path = lang + '/' + path
return this.config.url + '/' + path