- 新增 studio 应用与 /manage/ 写作台 - 文章增删改查、状态/分类/标签、搜索筛选分页 - 分类增删改查,支持父分类 - 直接上传 .md(front matter)并创建文章,编辑页支持 Markdown 导入 - Post 增加 content_format,公开文章页支持 Markdown 渲染 - 复用拾匣密码解锁;首页页脚新增写作台入口
89 lines
2.8 KiB
HTML
89 lines
2.8 KiB
HTML
{% extends "base_content.html" %}
|
|
|
|
{% block title %}{{ post.title }} · 拾光{% endblock %}
|
|
{% block description %}{{ post.title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<article class="article">
|
|
|
|
<header class="article-head">
|
|
{% if post.categories.all %}
|
|
<div class="article-cats">
|
|
{% for cat in post.categories.all %}
|
|
<a class="cat-chip" href="{{ cat.get_absolute_url }}">{{ cat.name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<h1 class="article-title">{{ post.title }}</h1>
|
|
|
|
{% if post.excerpt %}
|
|
<p class="article-lede">{{ post.excerpt|striptags }}</p>
|
|
{% endif %}
|
|
|
|
<div class="article-meta">
|
|
<span class="meta-item">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"
|
|
stroke-linecap="round" aria-hidden="true">
|
|
<rect x="3.5" y="5" width="17" height="15.5" rx="3"/>
|
|
<path d="M8 3.5v3M16 3.5v3M3.5 10h17"/>
|
|
</svg>
|
|
{{ post.published_at|date:"Y年n月j日" }}
|
|
</span>
|
|
<i class="dot" aria-hidden="true"></i>
|
|
<span class="meta-item">{{ char_count }} 字</span>
|
|
<i class="dot" aria-hidden="true"></i>
|
|
<span class="meta-item">约 {{ read_minutes }} 分钟读完</span>
|
|
</div>
|
|
|
|
<div class="article-orn" aria-hidden="true"><i></i><b>❋</b><i></i></div>
|
|
</header>
|
|
|
|
<!-- 窄屏折叠目录(内容由 reading.js 生成) -->
|
|
<details class="toc-mobile" id="tocMobile" hidden>
|
|
<summary>本篇目录</summary>
|
|
<ol class="toc-list"></ol>
|
|
</details>
|
|
|
|
<div class="article-card">
|
|
<div class="post-body" id="postBody">
|
|
{{ post.rendered_content|safe }}
|
|
</div>
|
|
|
|
{% if post.tags.all %}
|
|
<div class="article-tags">
|
|
<span class="tags-label">❋ 拾遗</span>
|
|
{% for tag in post.tags.all %}
|
|
<a class="tag-chip" href="{% url 'blog:tag_detail' slug=tag.slug %}"># {{ tag.name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<nav class="pager" aria-label="上一篇 / 下一篇">
|
|
{% if prev_post %}
|
|
<a class="pager-item prev" href="{{ prev_post.get_absolute_url }}" data-nav="prev">
|
|
<span class="pager-k">← 上一篇</span>
|
|
<span class="pager-t">{{ prev_post.title }}</span>
|
|
</a>
|
|
{% else %}
|
|
<span class="pager-item is-empty" aria-hidden="true"></span>
|
|
{% endif %}
|
|
|
|
{% if next_post %}
|
|
<a class="pager-item next" href="{{ next_post.get_absolute_url }}" data-nav="next">
|
|
<span class="pager-k">下一篇 →</span>
|
|
<span class="pager-t">{{ next_post.title }}</span>
|
|
</a>
|
|
{% else %}
|
|
<span class="pager-item is-empty" aria-hidden="true"></span>
|
|
{% endif %}
|
|
</nav>
|
|
|
|
<div class="article-foot">
|
|
<a class="btn-back" href="/">← 返回思维导航</a>
|
|
<span class="foot-note">字句织网 · 思绪成图</span>
|
|
</div>
|
|
</article>
|
|
{% endblock %}
|