Skip to content

Commit 48c8593

Browse files
SilverRainZDeepSeek
andcommitted
迁移至 recentupdate 2.0,重构首页和笔记页的最近更新区块
Co-authored-by: DeepSeek <service@deepseek.com>
1 parent 18bc2e1 commit 48c8593

4 files changed

Lines changed: 46 additions & 19 deletions

File tree

conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,12 @@
297297
# }
298298

299299
extensions.append('sphinxnotes.lilypond')
300-
lilypond_audio_volume = 300
300+
lilypond_audio_volume = 300.0
301301
lilypond_audio_format = 'mp3'
302302
lilypond_include_paths = ['/p/ly/inc']
303303

304304
extensions.append('sphinxnotes.recentupdate')
305-
recentupdate_date_format = _datefmt
306-
recentupdate_exclude_path = []
305+
recentupdate_count = 5
307306
recentupdate_exclude_commit = ['skip-recentupdate', 'conf']
308307

309308
if _D.is_public():

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sphinx-sitemap
2020
sphinxcontrib-plantuml
2121
sphinxcontrib.asciinema
2222
sphinx-reredirects
23-
sphinxnotes-recentupdate>=1.1
23+
sphinxnotes-recentupdate>=2.0
2424
sphinxnotes-mock
2525
sphinxext-opengraph
2626
matplotlib # for generating social cards

src/index.rst

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
.. container:: buttons
1818

19-
:ref:`联系我 <contact-me>`
20-
`源码 <https://github.com/SilverRainZ/bullet>`_
19+
最近更新_
20+
:ref:`联系我吧 <contact-me>`
2121

2222
.. grid:: 1 1 2 3
2323
:gutter: 1
@@ -72,3 +72,29 @@
7272
blog/transit/category
7373
blog/transit/tag
7474
blog/transit/feed
75+
76+
最近更新
77+
========
78+
79+
.. data.render::
80+
81+
{% set revs = load_extra('recentupdate', count=8) %}
82+
83+
.. container:: timeline
84+
85+
{% for r in revs %}
86+
.. card:: :octicon:`calendar` {{ r.date.strftime('%Y-%m-%d') }}
87+
:width: 50%
88+
:margin: 0 2 {{ loop.cycle('0 auto', 'auto 0') }}
89+
:class-card: surface
90+
91+
{% if r.changed_docs %}
92+
:修改了: {{ r.changed_docs | roles("doc") | join("、") }}
93+
{% endif %}
94+
{% if r.added_docs %}
95+
:新增了: {{ r.added_docs | roles("doc") | join("、") }}
96+
{% endif %}
97+
{% if r.removed_docs %}
98+
:删除了: {{ r.removed_docs | join("、") }}
99+
{% endif %}
100+
{% endfor %}

src/notes.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,26 @@ SilverRainZ 的笔记
6666
最近更新
6767
========
6868

69-
.. recentupdate:: 5
69+
.. data.render::
7070
71-
.. grid:: 1 1 2 2
72-
:gutter: 2
73-
:padding: 0
74-
:class-row: surface
71+
{% set revs = load_extra('recentupdate', count=8) %}
7572
76-
{% for r in revisions %}
77-
.. grid-item-card:: :octicon:`calendar` {{ r.date | strftime }}
73+
.. container:: timeline
7874
79-
{% if r.modification %}
80-
:修改了: {{ r.modification | roles("doc") | join("、") }}
75+
{% for r in revs %}
76+
.. card:: :octicon:`calendar` {{ r.date.strftime('%Y-%m-%d') }}
77+
:width: 50%
78+
:margin: 0 2 {{ loop.cycle('0 auto', 'auto 0') }}
79+
:class-card: surface
80+
81+
{% if r.changed_docs %}
82+
:修改了: {{ r.changed_docs | roles("doc") | join("、") }}
8183
{% endif %}
82-
{% if r.addition %}
83-
:新增了: {{ r.addition | roles("doc") | join("、") }}
84+
{% if r.added_docs %}
85+
:新增了: {{ r.added_docs | roles("doc") | join("、") }}
8486
{% endif %}
85-
{% if r.deletion %}
86-
:删除了: {{ r.deletion | join("、") }}
87+
{% if r.removed_docs %}
88+
:删除了: {{ r.removed_docs | join("、") }}
8789
{% endif %}
8890
{% endfor %}
8991

0 commit comments

Comments
 (0)