重做文章详情页:拾光阅读版式与目录/代码/灯箱交互
- 新增内容页外壳 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 移出版本库
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN" data-theme="light">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>{% block title %}拾光{% endblock %}</title>
|
||||
<meta name="description" content="{% block description %}把每一次思考 · 织成会生长的网{% endblock %}">
|
||||
|
||||
<!-- 主题预置:在样式生效前定好明暗,避免闪烁(键名与首页一致) -->
|
||||
<script>
|
||||
(function () {
|
||||
var t = 'light';
|
||||
try { t = localStorage.getItem('theme') || 'light'; } catch (e) {}
|
||||
document.documentElement.dataset.theme = (t === 'dark') ? 'dark' : 'light';
|
||||
})();
|
||||
</script>
|
||||
|
||||
<link rel="preconnect" href="https://fonts.loli.net">
|
||||
<link rel="preconnect" href="https://gstatic.loli.net" crossorigin>
|
||||
<link href="https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@500;600;700;900&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="{% static 'blog/css/reading.css' %}">
|
||||
<!-- 代码高亮(深色代码块配套主题) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github-dark.min.css">
|
||||
{% block extra_css %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#article">跳到正文</a>
|
||||
|
||||
<div class="page-glow" aria-hidden="true"><i></i><i></i><i></i></div>
|
||||
<div class="read-progress" id="readProgress" aria-hidden="true"><i></i></div>
|
||||
|
||||
<header class="site-head" id="siteHead">
|
||||
<a class="brand" href="/" aria-label="拾光 · 返回思维导航">
|
||||
<span class="brand-mark" aria-hidden="true">思</span>
|
||||
<span class="brand-text">
|
||||
<b>拾光</b>
|
||||
<small>MIND MAP · READING</small>
|
||||
</span>
|
||||
</a>
|
||||
<div class="head-actions">
|
||||
<a class="btn-map" href="/" title="返回思维导图">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"
|
||||
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M19 12H5M11 6l-6 6 6 6"/>
|
||||
</svg>
|
||||
<span>返回导图</span>
|
||||
</a>
|
||||
<button class="icon-btn" id="btnTheme" type="button" aria-label="切换明暗主题" title="切换主题(明 / 暗)">◐</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="reading" id="article">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- 侧栏目录:由 reading.js 根据正文标题生成 -->
|
||||
<aside class="toc" id="toc" hidden aria-label="本篇目录">
|
||||
<p class="toc-title"><span>✦</span>本篇目录</p>
|
||||
<ol class="toc-list"></ol>
|
||||
</aside>
|
||||
|
||||
<footer class="site-foot">
|
||||
<p>© 2026 拾光<span class="dot"></span>字句织网 · 思绪成图</p>
|
||||
</footer>
|
||||
|
||||
<script defer src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/highlight.min.js"></script>
|
||||
<script src="{% static 'blog/js/reading.js' %}"></script>
|
||||
{% block extra_js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user