mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-10 13:55:45 +00:00
fix(docs): ensure paginator helper has __()
local
Templates used for rendering data inside helpers need to all over their local variables passed down so they can be evaluated against some context object. We didn't pass down the i18n `__()` function to the paginator template of our custom theme resulting in compilation errors during site generation. This commit fixes it.
This commit is contained in:
parent
9f1c4cb329
commit
ebe61f4085
@ -6,6 +6,8 @@ hexo.extend.helper.register('docs_paginator', function() {
|
||||
const sidebar = this.site.data.sidebar[type];
|
||||
const path = pathFn.basename(this.path);
|
||||
const prefix = 'sidebar.' + type + '.';
|
||||
const __ = hexo.theme.i18n.__(this.page.lang || this.page.language);
|
||||
|
||||
let list = {};
|
||||
|
||||
for (var i in sidebar) {
|
||||
@ -19,6 +21,7 @@ hexo.extend.helper.register('docs_paginator', function() {
|
||||
|
||||
return nunjucks.render(pathFn.join(hexo.theme_dir, 'layout/partial/paginator.swig'), {
|
||||
prev: index < keys.length -1 ? { path: 'docs/'+keys[index+1] } : null,
|
||||
next: index > 0 ? { path: 'docs/'+keys[index-1] } : null
|
||||
next: index > 0 ? { path: 'docs/'+keys[index-1] } : null,
|
||||
__
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user