- 新增内容页外壳 base_content.html 与 reading.css / reading.js - 重写 post_detail.html:分类胶囊、阅读进度、首字下沉、代码块复制、 侧栏目录、上下篇、图片灯箱、明暗主题 - post_detail 视图补充上下篇、字数与阅读时长 - base.html 补 extra_css / extra_js block,修复脑图详情页样式不加载 - 加入 mindmaps、api、首页静态资源与模板 - 忽略 __pycache__ / *.pyc / *.back,并将已跟踪的 .pyc 移出版本库
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.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 %}
|