mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
feat: CDN可配置 cdnjs feat: cdn可設置 version 和 custom format feat: 點擊歸檔日期跳轉到頁面,標題顯示日期而不是‘歸檔’二字 closed #925 fix: Algolia搜索沒有結果 closed #923
14 lines
406 B
JavaScript
14 lines
406 B
JavaScript
/**
|
|
* 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
|
|
}) |