|
|
|
|
@ -4,71 +4,78 @@
|
|
|
|
|
<article id="post-{{ article.pk }} "
|
|
|
|
|
class="post-{{ article.pk }} post type-post status-publish format-standard hentry">
|
|
|
|
|
<header class="entry-header">
|
|
|
|
|
|
|
|
|
|
{# 文章标题 #}
|
|
|
|
|
<h1 class="entry-title">
|
|
|
|
|
{% if isindex %}
|
|
|
|
|
{% if isindex %}
|
|
|
|
|
{% if article.article_order > 0 %}
|
|
|
|
|
{# 置顶文章显示特殊标识 #}
|
|
|
|
|
<a href="{{ article.get_absolute_url }}"
|
|
|
|
|
rel="bookmark">【{% trans 'pin to top' %}】{{ article.title }}</a>
|
|
|
|
|
{% else %}
|
|
|
|
|
{# 普通文章标题链接 #}
|
|
|
|
|
<a href="{{ article.get_absolute_url }}"
|
|
|
|
|
rel="bookmark">{{ article.title }}</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
{# 文章详情页直接显示标题 #}
|
|
|
|
|
{{ article.title }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
|
{# 评论链接和浏览量 #}
|
|
|
|
|
<div class="comments-link">
|
|
|
|
|
{% if article.comment_status == "o" and open_site_comment %}
|
|
|
|
|
{# 显示评论数量和链接 #}
|
|
|
|
|
<a href="{{ article.get_absolute_url }}#comments" class="ds-thread-count" data-thread-key="3815"
|
|
|
|
|
rel="nofollow">
|
|
|
|
|
<span class="leave-reply">
|
|
|
|
|
{% if article.comment_set and article.comment_set.count %}
|
|
|
|
|
{{ article.comment_set.count }} {% trans 'comments' %}
|
|
|
|
|
{{ article.comment_set.count }} {% trans 'comments' %} {# 多条评论 #}
|
|
|
|
|
{% else %}
|
|
|
|
|
{% trans 'comment' %}
|
|
|
|
|
{% trans 'comment' %} {# 单数评论 #}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{# 文章浏览量 #}
|
|
|
|
|
<div style="float:right">
|
|
|
|
|
{{ article.views }} views
|
|
|
|
|
</div>
|
|
|
|
|
</div><!-- .comments-link -->
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
{# 面包屑导航(仅文章类型且非首页) #}
|
|
|
|
|
{% if article.type == 'a' %}
|
|
|
|
|
{% if not isindex %}
|
|
|
|
|
{% cache 36000 breadcrumb article.pk %}
|
|
|
|
|
{% load_breadcrumb article %}
|
|
|
|
|
{% cache 36000 breadcrumb article.pk %} {# 缓存面包屑10小时 #}
|
|
|
|
|
{% load_breadcrumb article %} {# 加载面包屑导航 #}
|
|
|
|
|
{% endcache %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
|
|
|
|
|
|
<div class="entry-content" itemprop="articleBody">
|
|
|
|
|
{% if isindex %}
|
|
|
|
|
{{ article.body|custom_markdown|escape|truncatechars_content }}
|
|
|
|
|
<p class='read-more'><a
|
|
|
|
|
href=' {{ article.get_absolute_url }}'>Read more</a></p>
|
|
|
|
|
{% if isindex %}
|
|
|
|
|
{# 首页文章摘要 #}
|
|
|
|
|
{{ article.body|custom_markdown|escape|truncatechars_content }} {# 截断显示 #}
|
|
|
|
|
<p class='read-more'><a href='{{ article.get_absolute_url }}'>Read more</a></p> {# 阅读更多链接 #}
|
|
|
|
|
{% else %}
|
|
|
|
|
|
|
|
|
|
{# 文章详情页内容 #}
|
|
|
|
|
{% if article.show_toc %}
|
|
|
|
|
{# 显示文章目录 #}
|
|
|
|
|
{% get_markdown_toc article.body as toc %}
|
|
|
|
|
<b>{% trans 'toc' %}:</b>
|
|
|
|
|
{{ toc|safe }}
|
|
|
|
|
|
|
|
|
|
<hr class="break_line"/>
|
|
|
|
|
{{ toc|safe }} {# 安全渲染HTML目录 #}
|
|
|
|
|
<hr class="break_line"/> {# 分隔线 #}
|
|
|
|
|
{% endif %}
|
|
|
|
|
<div class="article">
|
|
|
|
|
|
|
|
|
|
{{ article.body|custom_markdown|escape }}
|
|
|
|
|
|
|
|
|
|
{# 完整文章内容 #}
|
|
|
|
|
{{ article.body|custom_markdown|escape }} {# 渲染Markdown内容 #}
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
</div><!-- .entry-content -->
|
|
|
|
|
|
|
|
|
|
{# 加载文章元数据(标签、分类等) #}
|
|
|
|
|
{% load_article_metas article user %}
|
|
|
|
|
|
|
|
|
|
</article><!-- #post -->
|