mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-06-05 21:01:46 +08:00
feat: 美化 firefox 瀏覽器滾動條
fix: Utterances 評論區在多個頁面顯示的是同一個評論區 fix: 修復評論配置爲 Livere 和 Facebook Comments 時,最新評論模塊仍然顯示的 bug improvement: blueimp_md5 CDN 可配置 improvement: timeline 優化 improvement: css優化 improvement: 友情鏈接優化
This commit is contained in:
@@ -24,6 +24,7 @@ hexo.extend.filter.register('before_generate', () => {
|
||||
// comments
|
||||
gitalk: 'https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js',
|
||||
gitalk_css: 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css',
|
||||
blueimp_md5: 'https://cdn.jsdelivr.net/npm/blueimp-md5/js/md5.min.js',
|
||||
valine: 'https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js',
|
||||
disqusjs: 'https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js',
|
||||
disqusjs_css: 'https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css',
|
||||
|
||||
@@ -39,7 +39,7 @@ function randomCover () {
|
||||
return cover
|
||||
}
|
||||
} else {
|
||||
cover = theme.default_top_img || 'https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/img/default.jpg'
|
||||
cover = theme.default_top_img || 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
||||
return cover
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,12 @@ function timeLineFn (args, content) {
|
||||
const tlBlock = /<!--\s*timeline (.*?)\s*-->\n([\w\W\s\S]*?)<!--\s*endtimeline\s*-->/g
|
||||
|
||||
let result = ''
|
||||
let color = ''
|
||||
if (args.length) {
|
||||
args = hexo.render.renderSync({ text: args.join(' '), engine: 'markdown' })
|
||||
result += `<div class='timeline-item headline'><div class='timeline-item-title'><div class='item-circle'>${args}</div></div></div>`
|
||||
args = args.join(' ').split(',')
|
||||
color = args[1]
|
||||
const mdContent = hexo.render.renderSync({ text: args[0], engine: 'markdown' })
|
||||
result += `<div class='timeline-item headline'><div class='timeline-item-title'><div class='item-circle'>${mdContent}</div></div></div>`
|
||||
}
|
||||
|
||||
const matches = []
|
||||
@@ -32,7 +35,7 @@ function timeLineFn (args, content) {
|
||||
result += `<div class='timeline-item'>${tlTitleHtml + tlContentHtml}</div>`
|
||||
}
|
||||
|
||||
return `<div class="timeline">${result}</div>`
|
||||
return `<div class="timeline ${color}">${result}</div>`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('timeline', timeLineFn, { ends: true })
|
||||
|
||||
Reference in New Issue
Block a user