hexo-theme-keep/scripts/helper.js

17 lines
482 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* Hexo 扩展辅助函数Helper
* 补充复杂的业务逻辑
* https://hexo.io/zh-cn/api/helper.html
* eg 用法:<%= helper_test('xxx') %>
*/
hexo.extend.helper.register('helper_test', function (character) {
return character + '😁';
});
hexo.extend.helper.register('isInHomePaging', function (pagePath, route) {
if (pagePath.length > 5 && route === '/' ) {
return pagePath.slice(0, 5) === 'page/';
} else {
return false;
}
});