【Hexo插件系列】hexo-reference

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var renderFootnotes = require('./src/footnotes');
util = require('hexo-util');

// Register footnotes filter
hexo.extend.filter.register('before_post_render', function(data) {
data.content = renderFootnotes(data.content);
return data;
});

// Add CDN CSS resources
hexo.extend.filter.register('after_post_render', function(data) {
data.content =
util.htmlTag('link', {rel: 'stylesheet', type: 'text/css', href: 'https://cdn.jsdelivr.net/hint.css/2.4.1/hint.min.css'}) +
data.content;
return data;
});

是不是应该叫filter