You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DjangoBlog-Maintenance-Anal.../src/article_index.html

51 lines
2.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{# 继承基础模板,复用基础模板中的公共结构(如导航栏、页脚)和样式 #}
{% extends 'share_layout/base.html' %}
{% load blog_tags %}
{% load cache %}
{% block header %}
{% if tag_name %}
<title>{{ page_type }}:{{ tag_name }} | {{ SITE_DESCRIPTION }}</title>
{% comment %}<meta name="description" content="{{ page_type }}:{{ tag_name }}"/>{% endcomment %}
{% else %}
<title>{{ SITE_NAME }} | {{ SITE_DESCRIPTION }}</title>
{% endif %}
{# 页面元数据设置站点SEO描述用于搜索引擎抓取时展示的页面简介 #}
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/>
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/>
<meta property="og:type" content="blog"/>
<meta property="og:title" content="{{ SITE_NAME }}"/>
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/>
<meta property="og:url" content="{{ SITE_BASE_URL }}"/>
<meta property="og:site_name" content="{{ SITE_NAME }}"/>
{% endblock %}
{# 定义页面主要内容content的内容块承载文章列表和分页等核心内容 #}
{% block content %}
<div id="primary" class="site-content">
<div id="content" role="main">
{% if page_type and tag_name %}
<header class="archive-header">
<p class="archive-title">{{ page_type }}<span>{{ tag_name }}</span></p>
</header><!-- .archive-header -->
{% endif %}
{# 循环遍历文章列表article_list逐个渲染文章内容 #}
{% for article in article_list %}
{% load_article_detail article True user %}
{% endfor %}
{# 条件判断如果文章列表支持分页is_paginated为True则渲染分页控件 #}
{% if is_paginated %}
{% load_pagination_info page_obj page_type tag_name %}
{% endif %}
</div><!-- #content -->
</div><!-- #primary -->
{% endblock %}
{# 定义页面侧边栏sidebar的内容块承载侧边栏组件 #}
{% block sidebar %}
{# 调用自定义标签load_sidebar渲染侧边栏内容 #}
{% load_sidebar user linktype %}
{% endblock %}