[opt] wiki tag
This commit is contained in:
parent
b717668ab3
commit
2d4f203b43
|
@ -1,9 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('category_color', function(cat){
|
||||
const cfg = hexo.theme.config;
|
||||
if (cfg.article.category_color && cfg.article.category_color[cat]) {
|
||||
return ' style="color:' + cfg.article.category_color[cat] + '"';
|
||||
const { config } = hexo.theme
|
||||
const color = config.article.category_color[cat]
|
||||
if (color) {
|
||||
var textColor = color
|
||||
if (color.startsWith('#')) {
|
||||
textColor = color
|
||||
} else {
|
||||
textColor = '#' + color
|
||||
}
|
||||
var bgColor = textColor
|
||||
if (textColor.length == (1+3)) { // #fff
|
||||
bgColor += '2'
|
||||
} else if (textColor.length == (1+6)) { // #ffffff
|
||||
bgColor += '20'
|
||||
}
|
||||
return ` style="--text-p3:${textColor};--theme-block:${bgColor}"`;
|
||||
}
|
||||
return '';
|
||||
});
|
||||
return ''
|
||||
})
|
||||
|
|
|
@ -162,6 +162,10 @@
|
|||
flex: 1
|
||||
overflow: hidden
|
||||
word-wrap: break-word
|
||||
.cap
|
||||
background: var(--theme-block)
|
||||
padding: 2px 4px
|
||||
border-radius: 2px
|
||||
p:last-child
|
||||
margin-bottom: 0
|
||||
.cap+.cap
|
||||
|
|
Loading…
Reference in New Issue