-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. Feature: 增加頁面排版,可選擇把右邊欄放在左邊 3. Feature: 增加 Note (Bootstrap Callout) (移植於next主題) 4. Feature: 手機上能夠查看TOC 5. Feature: 增加直達評論按鈕 6. Fix: 修復post頁在寬度1024px下的顯示bug 7. Fix: 修復代碼框部分語言沒有顯示正確的代碼語言 8. Fix: 修復設置裏把Disqus註釋掉無法運行的bug
- Loading branch information
Showing
28 changed files
with
630 additions
and
172 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,9 @@ if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv | |
|
||
if theme.instantpage.enable | ||
script(src="https://cdn.jsdelivr.net/npm/[email protected]/instantpage.min.js" type="module") | ||
|
||
if theme.lazyload.enable | ||
script(src=url_for(theme.lazyload.script)) | ||
script. | ||
const observer = lozad(); // lazy loads elements with default selector as '.lozad' | ||
observer.observe(); |
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,4 +1,4 @@ | ||
if theme.disqus.enable | ||
if theme.disqus && theme.disqus.enable | ||
#disqus_thread | ||
script. | ||
var unused = null; | ||
|
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,35 +1,35 @@ | ||
if theme.disqus.enable | ||
if theme.disqus && theme.disqus.enable | ||
hr | ||
#post-comment | ||
.comment_headling | ||
i.fa.fa-comments.fa-fw(aria-hidden="true") | ||
span= _p('comment') | ||
span= ' ' + _p('comment') | ||
include ./disqus.pug | ||
else if theme.laibili && theme.laibili.enable | ||
hr | ||
#post-comment | ||
.comment_headling | ||
i.fa.fa-comments.fa-fw(aria-hidden="true") | ||
span= _p('comment') | ||
span= ' ' + _p('comment') | ||
include ./laibili.pug | ||
else if theme.gitment && theme.gitment.enable | ||
hr | ||
#post-comment | ||
.comment_headling | ||
i.fa.fa-comments.fa-fw(aria-hidden="true") | ||
span= _p('comment') | ||
span= ' ' + _p('comment') | ||
include ./gitment.pug | ||
else if theme.gitalk && theme.gitalk.enable | ||
hr | ||
#post-comment | ||
.comment_headling | ||
i.fa.fa-comments.fa-fw(aria-hidden="true") | ||
span= _p('comment') | ||
span= ' ' + _p('comment') | ||
include ./gitalk.pug | ||
else if theme.valine && theme.valine.enable | ||
hr | ||
#post-comment | ||
.comment_headling | ||
i.fa.fa-comments.fa-fw(aria-hidden="true") | ||
span= _p('comment') | ||
span= ' ' + _p('comment') | ||
include ./valine.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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#post_bottom | ||
#post_bottom_items | ||
a#to_comment(href="#post-comment") | ||
i.scroll_to_comment.fa.fa-comments | ||
i#mobile_toc.fa.fa-list | ||
#toc_mobile | ||
.toc_mobile_headline= _p('sidebar.catalog') | ||
!=toc(page.content,{"class":"toc_mobile_items"}) |
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
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 @@ | ||
/** | ||
* note.js | ||
* transplant from hexo-theme-next | ||
*/ | ||
|
||
'use strict'; | ||
|
||
function postNote(args, content) { | ||
return `<div class="note ${args.join(' ')}"> | ||
${hexo.render.renderSync({text: content, engine: 'markdown'}).split('\n').join('')} | ||
</div>`; | ||
} | ||
|
||
hexo.extend.tag.register('note', postNote, {ends: true}); | ||
hexo.extend.tag.register('subnote', postNote, {ends: true}); |
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,20 @@ | ||
'use strict'; | ||
let cheerio; | ||
hexo.extend.filter.register('after_post_render', data => { | ||
var theme = hexo.theme.config; | ||
if (!theme.lazyload.enable) return; | ||
|
||
if (!cheerio) cheerio = require('cheerio'); | ||
|
||
const $ = cheerio.load(data.content, {decodeEntities: false}); | ||
const images = $('img'); | ||
if (!images.length) return; | ||
|
||
images.each((i, o) => { | ||
let src = $(o).attr('src'); | ||
$(o).attr('data-src', src).removeAttr('src'); | ||
$(o).addClass('lozad'); | ||
}); | ||
|
||
data.content = $.html(); | ||
}, 0); |
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
Oops, something went wrong.