File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 99< a href ="{{ '../' ~ base_url }} ">
1010 < strong > Click here to go to latest.</ strong >
1111</ a >
12+ {% endblock %}
13+
14+ {% block content %}
15+ <!-- 先渲染原始内容 -->
16+ {{ super() }}
17+
18+ <!-- 添加过时警告逻辑 -->
19+ {% if page and page.meta.date %}
20+ {% set doc_date = page.meta.date %}
21+ {% set today = "" | as_datetime("%Y-%m-%d") %}
22+ {% set diff_days = (today | date("%s") - doc_date | date("%s")) // 86400 %}
23+
24+ {% if diff_days > 365 %}
25+ < div class ="md-typeset ">
26+ < div class ="md-admonition warning outdated-warning ">
27+ < p class ="md-admonition__title ">
28+ ⚠️ 文档过时提醒
29+ </ p >
30+ < p >
31+ 本文档最后更新于 < strong > {{ doc_date }}</ strong > ({{ diff_days }} 天前),
32+ 可能包含过时信息,请结合最新文档参考使用。
33+ </ p >
34+ </ div >
35+ </ div >
36+ {% endif %}
37+ {% endif %}
1238{% endblock %}
You can’t perform that action at this time.
0 commit comments