mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 14:07:06 +08:00
breaking changes: waline 適配 V2
breaking changes: waline 的 visitor 改為 pageview feat: algolia 搜索增加文章內容顯示和高亮 feat: 搜索內容顯示區域變大
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
- let { avatar,avatarCDN } = theme.waline
|
||||
|
||||
script.
|
||||
window.addEventListener('load', () => {
|
||||
const changeContent = (content) => {
|
||||
@@ -45,11 +43,11 @@ script.
|
||||
|
||||
const getComment = () => {
|
||||
const loadWaline = () => {
|
||||
Waline.Widget.RecentComments({
|
||||
Waline.RecentComments({
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
count: !{theme.newest_comments.limit}
|
||||
}).then(res => {
|
||||
const walineArray = res.comments.map(e => {
|
||||
}).then(({comments}) => {
|
||||
const walineArray = comments.map(e => {
|
||||
return {
|
||||
'content': changeContent(e.comment),
|
||||
'avatar': e.avatar,
|
||||
@@ -67,7 +65,7 @@ script.
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') loadWaline()
|
||||
else getScript('!{url_for(theme.asset.waline)}').then(loadWaline)
|
||||
else getScript('!{url_for(theme.asset.waline_js)}').then(loadWaline)
|
||||
}
|
||||
|
||||
const newestCommentInit = () => {
|
||||
|
||||
Reference in New Issue
Block a user