更新 'src/DjangoBlog-master/templates/blog/tags/article_meta_info.html'

fz_branch
pa2g3nmk9 4 months ago
parent 494b1f1f59
commit 1de6350414

@ -1,59 +1,51 @@
{% load i18n %}
{% load blog_tags %}
<footer class="entry-meta">
{% trans 'posted in' %}
{% trans 'posted in' %} {# 分类信息 #}
<a href="{{ article.category.get_absolute_url }}" rel="category tag">{{ article.category.name }}</a>
</a>
{% if article.type == '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 %}
{% if article.type == '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 ' %}
.{% trans 'by ' %} {# 作者信息 #}
<span class="by-author">
<span class="author vcard">
<a class="url fn n" href="{{ article.author.get_absolute_url }}"
{% blocktranslate %}
title="View all articles published by {{ article.author.username }}"
title="View all articles published by {{ article.author.username }}" {# 作者页面提示 #}
{% endblocktranslate %}
rel="author">
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name" itemprop="publisher">
{{ article.author.username }}
</span>
<span itemprop="author" itemscope itemtype="http://schema.org/Person"> {# 结构化数据 #}
<span itemprop="name" itemprop="publisher">
{{ article.author.username }} {# 作者用户名 #}
</span>
</span>
</a>
</a>
</span>
{% trans 'on' %}
<a href="{{ article.get_absolute_url }}"
title="{% datetimeformat article.pub_time %}"
itemprop="datePublished" content="{% datetimeformat article.pub_time %}"
rel="bookmark">
<time class="entry-date updated"
datetime="{{ article.pub_time }}">
{% datetimeformat article.pub_time %}</time>
{% if user.is_superuser %}
<a href="{{ article.get_admin_url }}">{% trans 'edit' %}</a>
{% endif %}
{% trans 'on' %} {# 发布时间 #}
<a href="{{ article.get_absolute_url }}"
title="{% datetimeformat article.pub_time %}" {# 发布时间提示 #}
itemprop="datePublished" content="{% datetimeformat article.pub_time %}"
rel="bookmark">
<time class="entry-date updated"
datetime="{{ article.pub_time }}"> {# 时间语义化标签 #}
{% datetimeformat article.pub_time %} {# 格式化显示时间 #}
</time>
</a>
{% if user.is_superuser %} {# 管理员显示编辑链接 #}
<a href="{{ article.get_admin_url }}">{% trans 'edit' %}</a> {# 编辑文章链接 #}
{% endif %}
</span>
</footer><!-- .entry-meta -->
</footer><!-- .entry-meta -->
Loading…
Cancel
Save