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_meta_info.html

63 lines
3.1 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.

{% load i18n %}
{% load blog_tags %}
<footer class="entry-meta"> <!-- 文章元数据区域(底部信息栏) -->
{% trans 'posted in' %} <!-- 翻译为“发布于” -->
<!-- 文章所属分类链接 -->
<a href="{{ article.category.get_absolute_url }}" rel="category tag">{{ article.category.name }}</a>
</a> <!-- 此处可能为多余闭合标签,需注意语法正确性 -->
{% if article.type == 'a' %} <!-- 若文章类型为普通文章(假设'a'代表文章) -->
{% if article.tags.all %} <!-- 若文章有关联标签 -->
{% trans 'and tagged' %} <!-- 翻译为“并标记为” -->
<!-- 循环输出所有标签 -->
{% for t in article.tags.all %}
<a href="{{ t.get_absolute_url }}" rel="tag">{{ t.name }}</a> <!-- 标签链接 -->
{% if t != article.tags.all.last %} <!-- 除最后一个标签外,添加逗号分隔 -->
,
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
.{% trans 'by ' %} <!-- 翻译为“作者:” -->
<span class="by-author"> <!-- 作者信息容器 -->
<span class="author vcard"> <!-- 符合hCard微格式的作者信息 -->
<!-- 作者主页链接 -->
<a class="url fn n" href="{{ article.author.get_absolute_url }}"
{% blocktranslate %} <!-- -->
title="View all articles published by {{ article.author.username }}" <!-- 鼠标悬停提示:查看该作者所有文章 -->
{% endblocktranslate %}
rel="author"> <!-- 标记为作者链接 -->
<!-- 符合Schema.org规范的作者信息 -->
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name" itemprop="publisher"> <!-- 作者名称(同时作为发布者) -->
{{ article.author.username }} <!-- 显示作者用户名 -->
</span>
</span>
</a>
</span>
{% trans 'on' %} <!-- 翻译为“发布时间:” -->
<!-- 文章详情页链接(带发布时间信息) -->
<a href="{{ article.get_absolute_url }}"
title="{% datetimeformat article.pub_time %}" <!-- -->
itemprop="datePublished" content="{% datetimeformat article.pub_time %}" <!-- Schema.org发布时间属性 -->
rel="bookmark"> <!-- 标记为永久链接 -->
<!-- 发布时间标签符合HTML5时间格式 -->
<time class="entry-date updated"
datetime="{{ article.pub_time }}"> <!-- datetime属性为机器可读格式 -->
{% datetimeformat article.pub_time %}</time> <!-- 显示格式化的发布时间(调用自定义标签) -->
{% if user.is_superuser %} <!-- 若当前用户是超级管理员 -->
<a href="{{ article.get_admin_url }}">{% trans 'edit' %}</a> <!-- 显示编辑链接(指向后台编辑页) -->
{% endif %}
</span>
</footer><!-- .entry-meta --> <!-- 元数据区域结束 -->