You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
624 B
22 lines
624 B
/** |
|
* note.js |
|
* transplant from hexo-theme-next |
|
*/ |
|
|
|
'use strict'; |
|
|
|
function postNote(args) { |
|
args = args.join(' ').split(',') |
|
let p0 = args[0].trim() |
|
let p1 = args[1].trim() |
|
return `<div class="note ${p0}">${hexo.render.renderSync({text: p1, engine: 'markdown'}).split('\n').join('')}</div>`; |
|
} |
|
|
|
function postNoteBlock(args, content) { |
|
return `<div class="note ${args.join(' ')}"> |
|
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')} |
|
</div>`; |
|
} |
|
|
|
hexo.extend.tag.register('note', postNote); |
|
hexo.extend.tag.register('noteblock', postNoteBlock, {ends: true});
|
|
|