This commit is contained in:
NaBian committed 2019-04-10 22:28:09 +08:00
1 parent 16ef430a39
commit 792897291b
445 files changed
+30584 -5

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
/* global hexo */
'use strict';
hexo.extend.helper.register('hexo_env', function(type) {
return this.env[type];
});
hexo.extend.helper.register('next_env', function(type) {
var path = require('path');
var env = require(path.normalize('../../package.json'));
return env[type];
});
hexo.extend.helper.register('item_active', function(path, className) {
var canonical = this.page.canonical_path;
var current = this.url_for(canonical).replace('index.html', '', 'g');
var result = '';
if (current.indexOf(path) !== -1) {
if (path !== '/' || path === current) {
result = ' ' + className;
}
}
return result;
});