From 244fbca94d738cf52076b8be69b03ca80c96da1f Mon Sep 17 00:00:00 2001 From: pa2g3nmk9 <3474779149@qq.com> Date: Sun, 19 Oct 2025 16:04:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/DjangoBlog-master/tem?= =?UTF-8?q?plates/blog/tags/article=5Finfo.html'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/blog/tags/article_info.html | 101 ++++++++++-------- 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/src/DjangoBlog-master/templates/blog/tags/article_info.html b/src/DjangoBlog-master/templates/blog/tags/article_info.html index 3deec44..a719b5b 100644 --- a/src/DjangoBlog-master/templates/blog/tags/article_info.html +++ b/src/DjangoBlog-master/templates/blog/tags/article_info.html @@ -1,74 +1,83 @@ -{% load blog_tags %} -{% load cache %} -{% load i18n %} -
-
+{% load blog_tags %} {# 加载自定义博客标签 #} +{% load cache %} {# 加载缓存标签 #} +{% load i18n %} {# 加载国际化标签 #} +
+ +
+ {# 文章标题 #}

- {% if isindex %} - {% if article.article_order > 0 %} - 【{% trans 'pin to top' %}】{{ article.title }} - {% else %} - {{ article.title }} + {% if isindex %} {# 如果是文章列表页 #} + {% if article.article_order > 0 %} {# 如果文章有置顶顺序 #} + + 【{% trans 'pin to top' %}】{{ article.title }} {# 显示置顶标记 #} + + {% else %} {# 普通文章 #} + + {{ article.title }} {# 普通标题 #} + {% endif %} - - {% else %} - {{ article.title }} + {% else %} {# 如果是文章详情页 #} + {{ article.title }} {# 直接显示标题,不带链接 #} {% endif %}

+ + {# 评论链接和浏览统计 #} +
- {% if article.type == 'a' %} - {% if not isindex %} - {% cache 36000 breadcrumb article.pk %} - {% load_breadcrumb article %} + + {# 面包屑导航(仅限文章详情页且不是列表页) #} + {% if article.type == 'a' %} {# 如果是文章类型 #} + {% if not isindex %} {# 如果不是列表页 #} + {% cache 36000 breadcrumb article.pk %} {# 缓存10小时 #} + {% load_breadcrumb article %} {# 加载面包屑导航 #} {% endcache %} {% endif %} {% endif %}
- + + {# 文章内容 #}
- {% if isindex %} + {% if isindex %} {# 列表页显示文章摘要 #} + {# 处理markdown并截断内容 #} {{ article.body|custom_markdown|escape|truncatechars_content }} -

Read more

- {% else %} - - {% if article.show_toc %} + {# "阅读更多"链接 #} +

Read more

+ {% else %} {# 详情页显示完整内容 #} + {% if article.show_toc %} {# 如果显示目录 #} + {# 生成markdown目录 #} {% get_markdown_toc article.body as toc %} - {% trans 'toc' %}: - {{ toc|safe }} - -
+ {% trans 'toc' %}: {# 目录标题 #} + {{ toc|safe }} {# 安全输出HTML目录 #} +
{# 分隔线 #} {% endif %} + + {# 完整文章内容 #}
- - {{ article.body|custom_markdown|escape }} - + {{ article.body|custom_markdown|escape }} {# 渲染完整markdown内容 #}
{% endif %} -
- + + {# 加载文章元信息(作者、分类、标签等) #} {% load_article_metas article user %} - +
\ No newline at end of file