init...
This commit is contained in:
14
themes/butterfly/scripts/events/comment.js
Normal file
14
themes/butterfly/scripts/events/comment.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Capitalize the first letter of comment name
|
||||
*/
|
||||
|
||||
hexo.extend.filter.register('before_generate', () => {
|
||||
const themeConfig = hexo.theme.config
|
||||
let { use } = themeConfig.comments
|
||||
if (!use) return
|
||||
if (typeof use === 'string') {
|
||||
use = use.split(',')
|
||||
}
|
||||
const newArray = use.map(item => item.toLowerCase().replace(/\b[a-z]/g, s => s.toUpperCase()))
|
||||
themeConfig.comments.use = newArray
|
||||
})
|
||||
Reference in New Issue
Block a user