hexo-theme-butterfly/scripts/tag/label.js
Jerry aa7173fc69 feature: 增加 tags 標簽外掛 - label
improvement: 優化 pjax 下 404 頁面
2021-04-25 22:08:07 +08:00

17 lines
299 B
JavaScript

/**
* Butterfly
* label
* {% label text color %}
*/
'use strict'
function addLabel (args, content) {
const text = args[0]
const className = args[1] || 'default'
return `<mark class="hl-label ${className}">${text}</mark> `
}
hexo.extend.tag.register('label', addLabel, { ends: false })