diff --git a/scripts/tags/index.js b/scripts/tags/index.js index d6ca370..f687b4c 100644 --- a/scripts/tags/index.js +++ b/scripts/tags/index.js @@ -43,4 +43,9 @@ hexo.extend.tag.register('hashtag', require('./lib/hashtag')(hexo)) hexo.extend.tag.register('okr', require('./lib/okr')(hexo), {ends: true}) hexo.extend.tag.register('audio', require('./lib/audio')(hexo)) hexo.extend.tag.register('video', require('./lib/video')(hexo)) + +// read 阅读类 +hexo.extend.tag.register('reel', require('./lib/read/reel')(hexo), true) +hexo.extend.tag.register('paper', require('./lib/read/paper')(hexo), true) + // others diff --git a/scripts/tags/lib/read/paper.js b/scripts/tags/lib/read/paper.js new file mode 100644 index 0000000..9fbf079 --- /dev/null +++ b/scripts/tags/lib/read/paper.js @@ -0,0 +1,90 @@ +/** + * paper.js v1.1 | https://github.com/HcGys/stellar/ + * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来) + * + * paper: + * {% paper [style:underline|无] [title:标题] [author:作者] [date:日期] [footer:footer] %} + * + * + * section-content + * + * + * paragraph-content + * + * + * line-content + * + * {% endpaper %} + * + */ + +'use strict' + +module.exports = ctx => function(args, content) { + var el = '' + args = ctx.args.map(args, ['style','title', 'author', 'date', 'footer']) + + el += '