forked from jerryc127/hexo-theme-butterfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 修復點擊toc後,滾動完toc的highlight在點擊的上一個元素 fix: 修復打賞按鈕Hover的bug close jerryc127#473 improvement: 友情鏈接界面增加title顯示(top_img設為false時) improvement: 優化toc顯示,當向上滾動時,導航欄不會遮擋 toc close jerryc127#472 improvement: 升級facebook comment sdk版本
- Loading branch information
Showing
27 changed files
with
399 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ page: | |
category: 分类 | ||
archives: 归档 | ||
|
||
card_post_count: 条评论 | ||
|
||
sticky: 置顶 | ||
no_title: 无题 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ page: | |
category: 分類 | ||
archives: 歸檔 | ||
|
||
card_post_count: 條評論 | ||
|
||
sticky: 置頂 | ||
no_title: 無題 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
.flink#article-container | ||
if site.data.link | ||
each i in site.data.link | ||
if i.class_name | ||
h2!= 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") | ||
if theme.lazyload.enable | ||
img(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) | ||
else | ||
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) | ||
span.flink-item-name= item.name | ||
span.flink-item-desc(title=item.descr)= item.descr | ||
!= page.content | ||
#article-container | ||
if top_img === false | ||
h1.page-title= page.title | ||
|
||
.flink | ||
if site.data.link | ||
each i in site.data.link | ||
if i.class_name | ||
h2!= 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") | ||
if theme.lazyload.enable | ||
img(data-lazy-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) | ||
else | ||
img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt=item.name ) | ||
span.flink-item-name= item.name | ||
span.flink-item-desc(title=item.descr)= item.descr | ||
!= page.content | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
.post-reward | ||
.reward-button | ||
.reward-button.button--animated | ||
i.fas.fa-qrcode | ||
= ' ' + _p('donate') | ||
.reward-main | ||
ul.reward-all | ||
each item in theme.reward.QR_code | ||
- var clickTo = item.link ? item.link : item.img | ||
li.reward-item | ||
a(href=url_for(clickTo) target='_blank') | ||
if theme.lazyload.enable | ||
img.post-qr-code-img(data-lazy-src=url_for(item.img) alt=item.text) | ||
else | ||
img.post-qr-code-img(src=url_for(item.img) alt=item.text) | ||
.post-qr-code-desc=item.text | ||
.reward-main | ||
ul.reward-all | ||
each item in theme.reward.QR_code | ||
- var clickTo = item.link ? item.link : item.img | ||
li.reward-item | ||
a(href=url_for(clickTo) target='_blank') | ||
if theme.lazyload.enable | ||
img.post-qr-code-img(data-lazy-src=url_for(item.img) alt=item.text) | ||
else | ||
img.post-qr-code-img(src=url_for(item.img) alt=item.text) | ||
.post-qr-code-desc=item.text | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
script. | ||
(() => { | ||
const getCount = () => { | ||
if (window.DISQUSWIDGETS === undefined) { | ||
var d = document, s = d.createElement('script'); | ||
s.src = 'https://!{theme.disqus.shortname}.disqus.com/count.js'; | ||
s.id = 'dsq-count-scr'; | ||
(d.head || d.body).appendChild(s); | ||
} else { | ||
DISQUSWIDGETS.getCount({reset: true}); | ||
} | ||
} | ||
|
||
window.pjax ? getCount() : window.addEventListener('load', getCount) | ||
|
||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
script. | ||
(()=>{ | ||
function loadFBComment () { | ||
if (typeof FB === 'object') FB.XFBML.parse() | ||
else { | ||
let ele = document.createElement('script') | ||
ele.setAttribute('src','https://connect.facebook.net/!{theme.facebook_comments.lang}/sdk.js#xfbml=1&version=v9.0') | ||
ele.setAttribute('async', 'true') | ||
ele.setAttribute('defer', 'true') | ||
ele.setAttribute('crossorigin', 'anonymous') | ||
document.body.appendChild(ele) | ||
} | ||
} | ||
window.pjax ? loadFBComment() : window.addEventListener('load', loadFBComment) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
case theme.comments.use[0] | ||
when 'Twikoo' | ||
include ./twikoo.pug | ||
when 'Disqus' | ||
when 'Disqusjs' | ||
include ./disqus.pug | ||
when 'Valine' | ||
include ./valine.pug | ||
when 'Waline' | ||
include ./waline.pug | ||
when 'Facebook Comments' | ||
include ./fb.pug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
script. | ||
(() => { | ||
const getCommentUrl = () => { | ||
const eleGroup = document.querySelectorAll('#recent-posts .article-title') | ||
let urlArray = [] | ||
eleGroup.forEach(i=>{ | ||
urlArray.push(i.getAttribute('href')) | ||
}) | ||
return urlArray | ||
} | ||
|
||
const getCount = () => { | ||
const runTwikoo = () => { | ||
twikoo.getCommentsCount({ | ||
envId: '!{theme.twikoo.envId}', | ||
region: '!{theme.twikoo.region}', | ||
urls: getCommentUrl(), | ||
includeReply: false | ||
}).then(function (res) { | ||
document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => { | ||
item.innerText = res[index].count | ||
}) | ||
}).catch(function (err) { | ||
console.log(err) | ||
}) | ||
} | ||
|
||
if (typeof twikoo === 'object') { | ||
runTwikoo() | ||
} else { | ||
getScript('!{theme.CDN.twikoo}').then(runTwikoo) | ||
} | ||
} | ||
|
||
window.pjax ? getCount() : window.addEventListener('load', getCount) | ||
|
||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
script. | ||
(() => { | ||
function loadValine () { | ||
function initValine () { | ||
let initData = { | ||
el: '#vcomment', | ||
appId: '#{theme.valine.appId}', | ||
appKey: '#{theme.valine.appKey}', | ||
} | ||
|
||
const valine = new Valine(initData) | ||
} | ||
|
||
if (typeof Valine === 'function') initValine() | ||
else getScript('!{url_for(theme.CDN.valine)}').then(initValine) | ||
} | ||
|
||
window.pjax ? loadValine() : window.addEventListener('load', loadValine) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
script. | ||
(() => { | ||
function loadWaline () { | ||
function initWaline () { | ||
let initData = { | ||
el: '#waline-wrap', | ||
serverURL: '!{theme.waline.serverURL}', | ||
} | ||
|
||
const waline = new Waline(initData) | ||
} | ||
|
||
if (typeof Waline === 'function') initWaline() | ||
else getScript('!{url_for(theme.CDN.waline)}').then(initWaline) | ||
} | ||
|
||
window.pjax ? loadWaline() : window.addEventListener('load', loadWaline) | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ | |
position: sticky | ||
position: -webkit-sticky | ||
top: 20px | ||
transition: top .3s | ||
|
||
.card-tag-cloud | ||
a | ||
|
Oops, something went wrong.