mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
1. Feature: 可關閉圖片懶加載
2. Feature: 增加頁面排版,可選擇把右邊欄放在左邊 3. Feature: 增加 Note (Bootstrap Callout) (移植於next主題) 4. Feature: 手機上能夠查看TOC 5. Feature: 增加直達評論按鈕 6. Fix: 修復post頁在寬度1024px下的顯示bug 7. Fix: 修復代碼框部分語言沒有顯示正確的代碼語言 8. Fix: 修復設置裏把Disqus註釋掉無法運行的bug
This commit is contained in:
@@ -34,10 +34,12 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
}
|
||||
|
||||
relatedPosts = relatedPosts.sort(compare('weight'));
|
||||
var lazy_src = hexo.theme.config.lazyload.enable ? lazy_src = 'data-src' : lazy_src = 'src'
|
||||
var lazy_class = hexo.theme.config.lazyload.enable ? lazy_class = 'lozad' : lazy_class = ''
|
||||
|
||||
if (relatedPosts.length > 0) {
|
||||
result += '<div class="relatedPosts">'
|
||||
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + headline_lang + '</span></div>'
|
||||
result += '<div class="relatedPosts_headline"><i class="fa fa-fw fa-thumbs-up" aria-hidden="true"></i><span>' + ' ' + headline_lang + '</span></div>'
|
||||
result += '<div class="relatedPosts_list">'
|
||||
|
||||
for (var i = 0; i < Math.min(relatedPosts.length, limit_num); i++) {
|
||||
@@ -45,7 +47,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
var cover = relatedPosts[i].cover || random_cover()
|
||||
|
||||
result += '<div class="relatedPosts_item"><a href="' + hexo.theme.config.rootConfig.root + relatedPosts[i].path + '" title="' + relatedPosts[i].title + '">';
|
||||
result += '<img class="relatedPosts_cover lozad" data-src="' + cover + '">';
|
||||
result += '<img class="relatedPosts_cover '+ lazy_class + '"' + lazy_src + '="' + cover + '">';
|
||||
result += '<div class="relatedPosts_title">' + relatedPosts[i].title + '</div>';
|
||||
result += '</a></div>'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user