canvas-nest.js 自 v8.0.0 後就因為 太消耗 CPU 被移除了,可以手動在 footer.njk
加入1
2custom_file_path:
footer: source/_data/footer.njk
source/_data/footer.njk
1
2
3{# canvas-nest #}
{# https://github.com/theme-next/theme-next-canvas-nest #}
<script color="34,34,34" opacity="0.5" zIndex="-1" count="99" src="https://cdnjs.cloudflare.com/ajax/libs/canvas-nest.js/1.0.1/canvas-nest.js"></script>
或者是使用新的 ribbon.js ,但是預設會有 點擊更換背景
的奇怪功能,還是需要手動引入把這功能取消掉,Next 的設定則不需要打開1
2canvas_ribbon:
enable: false
source/_data/footer.njk
1
2
3
4
5
6
7
8
9{# ribbon.js without click #}
{# https://github.com/hustcc/ribbon.js #}
<script>
function removeRibbonClick() {
document.onclick = null
document.ontouchstart = null
}
</script>
<script size="150" alpha='0.4' zIndex="-1" src="https://cdnjs.cloudflare.com/ajax/libs/ribbon.js/1.0.2/ribbon.min.js" onload="removeRibbonClick()"></script>
因應圓角設計,上方增加間距1
2
3
4
5
6// padding-top for main
+desktop() {
.main {
padding-top: 12px; // same as sidebar margin-top
}
}
預設太過方正,增加圓角讓畫面更加舒服
延伸閱讀: UI/UX|下次主管問你為什麼 UI 要用圓角的時候1
2
3
4
5
6
7// rounded corners
+desktop() {
.header-inner, .sidebar-inner, .post-block, .comments, .pagination {
overflow: hidden;
border-radius: 12px ;
}
}
移除最上方的 headband1
2
3
4// remove headband
.headband {
display: none ;
}
mobile 顯示 subtitle 時會讓 header 看起來過高,所以隱藏讓版面看起來更舒服1
2
3
4
5
6// hide subtitle for mobile
+tablet-mobile() {
.site-subtitle {
display: none ;
}
}
1 | // Hide "Keep on posting" |
h1 過多會影響SEO,我的內文子標題通常是用 h2 和 h3,但是預設 h3 會有底線,不太好辨識是 h2 還是 h3,所以把 h3 的底線隱藏1
2
3.post-body h3 {
border-bottom: none ;
}