mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-06-06 05:11:45 +08:00
feature: 增加 tags 標簽外掛 - label
improvement: 優化 pjax 下 404 頁面
This commit is contained in:
@@ -9,7 +9,10 @@ hexo.extend.generator.register('404', function (locals) {
|
||||
if (!hexo.theme.config.error_404.enable) return
|
||||
return {
|
||||
path: '404.html',
|
||||
data: locals.posts,
|
||||
layout: ['404']
|
||||
layout: ['page'],
|
||||
data: {
|
||||
type: '404',
|
||||
top_img: false
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 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 })
|
||||
Reference in New Issue
Block a user