From 5c7e28cf65615b9f6d32a2a3c15455496a257c1d Mon Sep 17 00:00:00 2001 From: pa2g3nmk9 <3474779149@qq.com> Date: Wed, 5 Nov 2025 23:40:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'src/DjangoBlog-master/tem?= =?UTF-8?q?plates/blog/article=5Findex.html'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/blog/article_index.html | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/DjangoBlog-master/templates/blog/article_index.html b/src/DjangoBlog-master/templates/blog/article_index.html index 0ee6150..0a5bbb2 100644 --- a/src/DjangoBlog-master/templates/blog/article_index.html +++ b/src/DjangoBlog-master/templates/blog/article_index.html @@ -1,42 +1,43 @@ -{% extends 'share_layout/base.html' %} -{% load blog_tags %} -{% load cache %} -{% block header %} - {% if tag_name %} - {{ page_type }}:{{ tag_name }} | {{ SITE_DESCRIPTION }} - {% comment %}{% endcomment %} - {% else %} - {{ SITE_NAME }} | {{ SITE_DESCRIPTION }} +``` +{% extends 'share_layout/base.html' %} {# 继承基础布局模板 #} +{% load blog_tags %} {# 加载博客自定义标签 #} +{% load cache %} {# 加载缓存标签 #} +{% block header %} {# 头部内容块 #} + {% if tag_name %} {# 如果存在标签名称 #} + {{ page_type }}:{{ tag_name }} | {{ SITE_DESCRIPTION }} {# 带标签的页面标题 #} + {% comment %}{% endcomment %} {# 注释掉的描述 #} + {% else %} {# 如果没有标签名称 #} + {{ SITE_NAME }} | {{ SITE_DESCRIPTION }} {# 默认页面标题 #} {% endif %} - - - - - - - + {# 页面描述 #} + {# 页面关键词 #} + {# OpenGraph类型 #} + {# OpenGraph标题 #} + {# OpenGraph描述 #} + {# OpenGraph网址 #} + {# OpenGraph站点名称 #} {% endblock %} -{% block content %} -
-
- {% if page_type and tag_name %} -
+{% block content %} {# 主要内容块 #} +
{# 主要内容区域 #} +
{# 内容区域 #} + {% if page_type and tag_name %} {# 如果存在页面类型和标签名称 #} +
{# 归档页眉 #} -

{{ page_type }}:{{ tag_name }}

+

{{ page_type }}:{{ tag_name }}

{# 归档标题 #}
{% endif %} - {% for article in article_list %} - {% load_article_detail article True user %} + {% for article in article_list %} {# 遍历文章列表 #} + {% load_article_detail article True user %} {# 加载文章详情 #} {% endfor %} - {% if is_paginated %} - {% load_pagination_info page_obj page_type tag_name %} + {% if is_paginated %} {# 如果启用了分页 #} + {% load_pagination_info page_obj page_type tag_name %} {# 加载分页信息 #} {% endif %}
{% endblock %} -{% block sidebar %} - {% load_sidebar user linktype %} +{% block sidebar %} {# 侧边栏块 #} + {% load_sidebar user linktype %} {# 加载侧边栏内容 #} {% endblock %} \ No newline at end of file