mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
feat: 置頂圖標改為在標題左側 feat: 可配置打賞按鈕的文字 feat: 側邊欄增加 系列文章顯示 feat: 增加 series 系列文章 標籤外掛 feat: 移除 addthis 分享 improvement: 代碼優化 improvement: tabs 標籤外掛的回到頂部箭頭位置調整 improvement: 更新 plugin.yml
28 lines
774 B
JavaScript
28 lines
774 B
JavaScript
/**
|
|
* note.js
|
|
* transplant from hexo-theme-next
|
|
* Modify by Jerry
|
|
*/
|
|
|
|
'use strict'
|
|
|
|
const postNote = (args, content) => {
|
|
const styleConfig = hexo.theme.config.note.style
|
|
const noteTag = ['flat', 'modern', 'simple', 'disabled']
|
|
if (!noteTag.includes(args[args.length - 1])) {
|
|
args.push(styleConfig)
|
|
}
|
|
|
|
let icon = ''
|
|
const iconArray = args[args.length - 2]
|
|
if (iconArray && iconArray.startsWith('fa')) {
|
|
icon = `<i class="note-icon ${iconArray}"></i>`
|
|
args[args.length - 2] = 'icon-padding'
|
|
}
|
|
|
|
return `<div class="note ${args.join(' ')}">${icon + hexo.render.renderSync({ text: content, engine: 'markdown' })}</div>`
|
|
}
|
|
|
|
hexo.extend.tag.register('note', postNote, { ends: true })
|
|
hexo.extend.tag.register('subnote', postNote, { ends: true })
|