File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{% comment %} 自定义 < head > 扩展:favicon 已在 default.html 引入,此处可放统计代码 / 自定义 meta {% endcomment %}
2+ < script >
3+ // 在首次绘制前确定配色,避免深色模式下的白屏闪烁
4+ ( function ( ) {
5+ var saved = null ;
6+ try { saved = localStorage . getItem ( 'theme' ) ; } catch ( e ) { /* 隐私模式 */ }
7+ if ( ! saved && window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) {
8+ saved = 'dark' ;
9+ }
10+ document . documentElement . setAttribute ( 'data-theme' , saved === 'dark' ? 'dark' : 'light' ) ;
11+ } ) ( ) ;
12+ </ script >
Original file line number Diff line number Diff line change @@ -60,5 +60,6 @@ <h1><a href="{{ "/" | absolute_url }}">{{ site.title | default: site.github.repo
6060 </ footer >
6161 </ div >
6262 < script src ="{{ "/assets/js/scale.fix.js" | relative_url }}"> </ script >
63+ < script src ="{{ "/assets/js/blog.js" | relative_url }}?v={{ site.time | date: "%s" }}"> </ script >
6364 </ body >
6465</ html >
Original file line number Diff line number Diff line change 11---
22layout: default
33---
4- < h1 > {{ page.title }}</ h1 >
4+ < article class ="post ">
5+ < h1 > {{ page.title }}</ h1 >
56
6- < small > {{ page.date | date: "%Y年%-m月%-d日" }}</ small >
7+ < p class ="post-meta ">
8+ < small > {{ page.date | date: "%Y年%-m月%-d日" }}</ small >
9+ < span class ="dot "> ·</ span >
10+ < small data-reading-time > 阅读时长计算中…</ small >
11+ {% if page.categories and page.categories.size > 0 %}
12+ < span class ="dot "> ·</ span >
13+ < small > {% for c in page.categories %}{{ c }}{% unless forloop.last %} / {% endunless %}{% endfor %}</ small >
14+ {% endif %}
15+ </ p >
716
8- {{ content }}
17+ < div id =" toc " class =" toc collapsed " hidden > </ div >
918
19+ {{ content }}
20+
21+ {% if page.tags and page.tags.size > 0 %}
22+ < p class ="post-tags ">
23+ {% for tag in page.tags %}
24+ < a href ="{{ "/tags/" | relative_url }}#{{ tag | slugify }}"> #{{ tag }}</ a >
25+ {% endfor %}
26+ </ p >
27+ {% endif %}
28+
29+ {% if page.previous or page.next %}
30+ < nav class ="post-nav ">
31+ {% if page.previous %}
32+ < a class ="prev " href ="{{ page.previous.url | relative_url }} ">
33+ < span class ="label "> ← 上一篇</ span > {{ page.previous.title }}
34+ </ a >
35+ {% endif %}
36+ {% if page.next %}
37+ < a class ="next " href ="{{ page.next.url | relative_url }} ">
38+ < span class ="label "> 下一篇 →</ span > {{ page.next.title }}
39+ </ a >
40+ {% endif %}
41+ </ nav >
42+ {% endif %}
43+ </ article >
You can’t perform that action at this time.
0 commit comments