add doc
This commit is contained in:
1 parent
16ef430a39
commit
792897291b
445 files changed
+30584
-5
No files matched your search
+26
@@ -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;
|
||||
});
|
||||
Reference in new issue
Block a user