mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:30:54 +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:
@@ -40,18 +40,29 @@
|
||||
|
||||
else
|
||||
if site.data.link
|
||||
- let result = ''
|
||||
each i in site.data.link
|
||||
if i.class_name
|
||||
!=markdown(`## ${i.class_name}`)
|
||||
if i.class_desc
|
||||
.flink-desc!=i.class_desc
|
||||
.flink-list
|
||||
each item in i.link_list
|
||||
.flink-list-item
|
||||
a(href=url_for(item.link) title=item.name target="_blank")
|
||||
.flink-item-icon
|
||||
img.no-lightbox(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name )
|
||||
.flink-item-name= item.name
|
||||
.flink-item-desc(title=item.descr)= item.descr
|
||||
- let className = i.class_name ? markdown(`## ${i.class_name}`) : ''
|
||||
- let classDesc = i.class_desc ? `<div class='flink-desc'>${i.class_desc}</div>` : ''
|
||||
|
||||
- let listResult = ''
|
||||
|
||||
each j in i.link_list
|
||||
-
|
||||
listResult += `
|
||||
<div class="flink-list-item">
|
||||
<a href='${j.link}' title='${j.name}' target='_blank'>
|
||||
<div class='flink-item-icon'>
|
||||
<img class='no-lightbox' src='${j.avatar}' onerror='this.onerror=null;this.src="${url_for(theme.error_img.flink)}"' alt='${j.name}' />
|
||||
</div>
|
||||
<div class='flink-item-name'>${j.name}</div>
|
||||
<div class='flink-item-desc' title='${j.descr}'>${j.descr}</div>
|
||||
</a>
|
||||
</div>`
|
||||
-
|
||||
|
||||
- result += `${className}${classDesc} <div class='flink-list'>${listResult}</div>`
|
||||
|
||||
- page.content = result + page.content
|
||||
!= page.content
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- let default_avatar = theme.valine.avatar
|
||||
|
||||
script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.17.0/js/md5.min.js")
|
||||
script(src=url_for(theme.CDN.blueimp_md5))
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
|
||||
22
layout/includes/third-party/pjax.pug
vendored
22
layout/includes/third-party/pjax.pug
vendored
@@ -3,20 +3,18 @@ if theme.pjax.exclude
|
||||
each val in theme.pjax.exclude
|
||||
- pjaxExclude = pjaxExclude + `:not([href="${val}"])`
|
||||
|
||||
- let pjaxSelectors = ['title','#config-diff','#body-wrap','#rightside-config-hide','#rightside-config-show','.js-pjax']
|
||||
|
||||
- let choose = theme.comments.use
|
||||
if choose
|
||||
if theme.Open_Graph_meta && (choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus'))
|
||||
- pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
|
||||
if choose.includes('Utterances') || choose.includes('Giscus')
|
||||
- pjaxSelectors.unshift('link[rel="canonical"]')
|
||||
|
||||
script(src=url_for(theme.CDN.pjax))
|
||||
script.
|
||||
let pjaxSelectors = [
|
||||
'title',
|
||||
'#config-diff',
|
||||
'#body-wrap',
|
||||
'#rightside-config-hide',
|
||||
'#rightside-config-show',
|
||||
'.js-pjax'
|
||||
]
|
||||
|
||||
if (!{Boolean(theme.Open_Graph_meta && theme.comments.use && theme.comments.use.includes('Livere'))}) {
|
||||
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
|
||||
}
|
||||
let pjaxSelectors = !{JSON.stringify(pjaxSelectors)}
|
||||
|
||||
var pjax = new Pjax({
|
||||
elements: '!{pjaxExclude}',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if theme.newest_comments.enable
|
||||
if theme.newest_comments.enable && !['Livere','Facebook Comments','Giscus'].includes(theme.comments.use[0])
|
||||
.card-widget#card-newest-comments
|
||||
.item-headline
|
||||
i.fas.fa-comment-dots
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#aside-content.aside-content
|
||||
//- post
|
||||
if is_post()
|
||||
- const tocStyle = page.style_simple
|
||||
- const tocStyle = page.toc_style_simple
|
||||
- const tocStyleVal = tocStyle === true || tocStyle === false ? tocStyle : theme.toc.style_simple
|
||||
if showToc && tocStyleVal
|
||||
.sticky_layout
|
||||
|
||||
Reference in New Issue
Block a user