|
|
|
|
@ -1,42 +1,43 @@
|
|
|
|
|
{% extends 'share_layout/base.html' %}
|
|
|
|
|
{% load blog_tags %}
|
|
|
|
|
{% load cache %}
|
|
|
|
|
{% load i18n %}
|
|
|
|
|
{% block header %}
|
|
|
|
|
|
|
|
|
|
<title>{% trans 'article archive' %} | {{ SITE_DESCRIPTION }}</title>
|
|
|
|
|
|
|
|
|
|
<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 }}"/>
|
|
|
|
|
```
|
|
|
|
|
{% extends 'share_layout/base.html' %} {# 继承基础布局模板 #}
|
|
|
|
|
{% load blog_tags %} {# 加载博客自定义标签 #}
|
|
|
|
|
{% load cache %} {# 加载缓存标签 #}
|
|
|
|
|
{% load i18n %} {# 加载国际化标签 #}
|
|
|
|
|
{% block header %} {# 头部内容块 #}
|
|
|
|
|
|
|
|
|
|
<title>{% trans 'article archive' %} | {{ SITE_DESCRIPTION }}</title> {# 页面标题 #}
|
|
|
|
|
|
|
|
|
|
<meta name="description" content="{{ SITE_SEO_DESCRIPTION }}"/> {# 页面描述 #}
|
|
|
|
|
<meta name="keywords" content="{{ SITE_KEYWORDS }}"/> {# 页面关键词 #}
|
|
|
|
|
<meta property="og:type" content="blog"/> {# OpenGraph类型 #}
|
|
|
|
|
<meta property="og:title" content="{{ SITE_NAME }}"/> {# OpenGraph标题 #}
|
|
|
|
|
<meta property="og:description" content="{{ SITE_DESCRIPTION }}"/> {# OpenGraph描述 #}
|
|
|
|
|
<meta property="og:url" content="{{ SITE_BASE_URL }}"/> {# OpenGraph网址 #}
|
|
|
|
|
<meta property="og:site_name" content="{{ SITE_NAME }}"/> {# OpenGraph站点名称 #}
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|
|
|
|
|
{% block content %}
|
|
|
|
|
<div id="primary" class="site-content">
|
|
|
|
|
<div id="content" role="main">
|
|
|
|
|
{% block content %} {# 主要内容块 #}
|
|
|
|
|
<div id="primary" class="site-content"> {# 主要内容区域 #}
|
|
|
|
|
<div id="content" role="main"> {# 内容区域 #}
|
|
|
|
|
|
|
|
|
|
<header class="archive-header">
|
|
|
|
|
<header class="archive-header"> {# 归档页眉 #}
|
|
|
|
|
|
|
|
|
|
<p class="archive-title">{% trans 'article archive' %}</p>
|
|
|
|
|
<p class="archive-title">{% trans 'article archive' %}</p> {# 归档标题 #}
|
|
|
|
|
</header><!-- .archive-header -->
|
|
|
|
|
|
|
|
|
|
<div class="entry-content">
|
|
|
|
|
|
|
|
|
|
{% regroup article_list by pub_time.year as year_post_group %}
|
|
|
|
|
<ul>
|
|
|
|
|
{% for year in year_post_group %}
|
|
|
|
|
<li>{{ year.grouper }} {% trans 'year' %}
|
|
|
|
|
{% regroup year.list by pub_time.month as month_post_group %}
|
|
|
|
|
<ul>
|
|
|
|
|
{% for month in month_post_group %}
|
|
|
|
|
<li>{{ month.grouper }} {% trans 'month' %}
|
|
|
|
|
<ul>
|
|
|
|
|
{% for article in month.list %}
|
|
|
|
|
<li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a>
|
|
|
|
|
<div class="entry-content"> {# 条目内容 #}
|
|
|
|
|
|
|
|
|
|
{% regroup article_list by pub_time.year as year_post_group %} {# 按年份分组文章 #}
|
|
|
|
|
<ul> {# 年份列表 #}
|
|
|
|
|
{% for year in year_post_group %} {# 遍历年份组 #}
|
|
|
|
|
<li>{{ year.grouper }} {% trans 'year' %} {# 显示年份 #}
|
|
|
|
|
{% regroup year.list by pub_time.month as month_post_group %} {# 按月份分组 #}
|
|
|
|
|
<ul> {# 月份列表 #}
|
|
|
|
|
{% for month in month_post_group %} {# 遍历月份组 #}
|
|
|
|
|
<li>{{ month.grouper }} {% trans 'month' %} {# 显示月份 #}
|
|
|
|
|
<ul> {# 文章列表 #}
|
|
|
|
|
{% for article in month.list %} {# 遍历文章 #}
|
|
|
|
|
<li><a href="{{ article.get_absolute_url }}">{{ article.title }}</a> {# 文章链接 #}
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
|
|
|
|
@ -53,8 +54,6 @@
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% block sidebar %}
|
|
|
|
|
{% load_sidebar user 'i' %}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% block sidebar %} {# 侧边栏块 #}
|
|
|
|
|
{% load_sidebar user 'i' %} {# 加载侧边栏内容 #}
|
|
|
|
|
{% endblock %}
|