✨ 評論增加lazyload

✨ 頭像/打賞圖片 增加lazyload
✨ 調整移動端 ol ul 的邊距 #267
🐛 修復Valine 的requiredFields設置為空 無效的bugs
This commit is contained in:
Jerry committed 2020-07-26 15:33:47 +08:00
1 parent d5cf43a6b4
commit d2943bbbb1
26 files changed
+176 -161

No files matched your search

+14 -11
View File
@@ -101,11 +101,11 @@ default_top_img: https://i.loli.net/2020/05/01/IuWi8QbHvzjlOPw.jpg
archive_img: archive_img:
# the banner image of tag page # the banner image of tag page
# tag page, look like https://xxxxxxxxx.com/tags/butterfly # note: tag page, not tags page (子標籤頁面的 top_img)
tag_img: tag_img:
# the banner image of category page # the banner image of category page
# category page, look like https://xxxxxxxxx.com/categories/butterfly # note: category page, not categories page (子分類頁面的 top_img)
category_img: category_img:
# If you are using hexo-douban, you can configure it (如果你有使用 hexo-douban,可配置這個) # If you are using hexo-douban, you can configure it (如果你有使用 hexo-douban,可配置這個)
@@ -251,7 +251,9 @@ comments:
# - Valine # - Valine
# - Disqus # - Disqus
text: true # Display the comment name next to the button text: true # Display the comment name next to the button
load_begin: false # The second comment system will auto load when visiting the website # lazyload: The comment system will be load when comment element enters the browser's viewport.
# If you set it to false, the comment count will be invalid
lazyload: false
count: false # Display comment count in top_img count: false # Display comment count in top_img
# disqus # disqus
@@ -368,14 +370,13 @@ crisp:
# Footer Settings # Footer Settings
# -------------------------------------- # --------------------------------------
footer: footer:
owner: # 顯示站長信息 owner:
enable: true enable: true
since: 2020 since: 2020
custom_text: Hi, welcome to my blog! # 頁腳自定義文本 custom_text:
copyright: true # 顯示框架及主題作者信息 copyright: true # Copyright of theme and framework
ICP: # 備案信息 ICP: # Chinese ICP License
enable: false enable: false
url: url:
text: text:
@@ -456,7 +457,7 @@ yandex_site_verification:
# The top_img settings of home page # The top_img settings of home page
# default: top img - full screen, site info - middle (默認top_img全屏,site_info在中間) # default: top img - full screen, site info - middle (默認top_img全屏,site_info在中間)
# The positon of site info, eg: 300px/300em/300rem/10% (主頁標題距離頂部距離) # The position of site info, eg: 300px/300em/300rem/10% (主頁標題距離頂部距離)
index_site_info_top: index_site_info_top:
# The height of top_img, eg: 300px/300em/300rem (主頁top_img高度) # The height of top_img, eg: 300px/300em/300rem (主頁top_img高度)
index_top_img_height: index_top_img_height:
@@ -553,12 +554,12 @@ font:
# 左上角網站名字 主頁居中網站名字 # 左上角網站名字 主頁居中網站名字
blog_title_font: blog_title_font:
font_link: https://fonts.googleapis.com/css?family=Titillium+Web&display=swap font_link: https://fonts.googleapis.com/css?family=Titillium+Web&display=swap
font-family: Titillium Web, 'PingFang SC', 'Hiragino Sans GB', Microsoft YaHei', sans-serif font-family: Titillium Web, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif
# The setting of divider icon (水平分隔線圖標設置) # The setting of divider icon (水平分隔線圖標設置)
hr_icon: hr_icon:
enable: true enable: true
icon: # the unicode value of Font Awesome icon icon: # the unicode value of Font Awesome icon, such as '\3423'
icon-top: icon-top:
# the subtitle on homepage (主頁subtitle) # the subtitle on homepage (主頁subtitle)
@@ -707,6 +708,8 @@ note:
# other # other
# -------------------------------------- # --------------------------------------
# Pjax [Beta]
# It may contain bugs and unstable, give feedback when you find the bugs.
# https://github.com/MoOx/pjax # https://github.com/MoOx/pjax
pjax: false pjax: false
+2 -7
View File
@@ -43,10 +43,10 @@ div
//- 鼠標特效 //- 鼠標特效
if theme.click_heart if theme.click_heart
script(src=url_for(theme.CDN.click_heart)) script(src=url_for(theme.CDN.click_heart) async)
if theme.ClickShowText && theme.ClickShowText.enable if theme.ClickShowText && theme.ClickShowText.enable
script(src=url_for(theme.CDN.ClickShowText)) script(src=url_for(theme.CDN.ClickShowText) async)
if theme.pangu && theme.pangu.enable if theme.pangu && theme.pangu.enable
include ./third-party/pangu.pug include ./third-party/pangu.pug
@@ -76,11 +76,6 @@ div
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
script(async src=url_for(theme.CDN.busuanzi)) script(async src=url_for(theme.CDN.busuanzi))
if theme.pjax && theme.comments && theme.comments.use
!=partial('includes/comments/js-load-all', {}, {cache:theme.fragment_cache})
else if commentsJsLoad
!=partial('includes/comments/js-load-all', {}, {cache:theme.fragment_cache})
if theme.aplayerInject && !config.aplayer.asset_inject if theme.aplayerInject && !config.aplayer.asset_inject
if theme.pjax if theme.pjax
include ./head/aplayer.pug include ./head/aplayer.pug
+9 -12
View File
@@ -13,30 +13,27 @@ script.
}) })
} }
if (window.DISQUS) { if (window.DISQUS) disqusReset()
disqusReset() else {
} else {
(function() { (function() {
var d = document, s = d.createElement('script') var d = document, s = d.createElement('script');
s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js' s.src = 'https://!{theme.disqus.shortname}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date())
s.setAttribute('data-timestamp', +new Date()); s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s); (d.head || d.body).appendChild(s);
})(); })();
} }
} }
if ('!{defaultComment}' === 'Disqus' || !{theme.comments.load_begin}) { if ('!{theme.comments.use[0]}' === 'Disqus' || !!{theme.comments.lazyload}) {
loadDisqus() if (!{theme.comments.lazyload}) loadComment(document.getElementById('disqus_thread'), loadDisqus)
} else loadDisqus()
else { } else {
function loadOtherComment () { function loadOtherComment () {
loadDisqus() loadDisqus()
} }
} }
if is_post() && !theme.comments.lazyload && theme.comments.count && theme.comments.use[0] === 'Disqus'
if is_post() && theme.comments.count && defaultComment === 'Disqus'
script. script.
if (window.DISQUSWIDGETS === undefined) { if (window.DISQUSWIDGETS === undefined) {
var d = document, s = d.createElement('script'); var d = document, s = d.createElement('script');
Loaded 3 of 26 files, more files were not shown because too many files have changed in this diff. Show more