- 新增内容页外壳 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 移出版本库
14 lines
431 B
Python
14 lines
431 B
Python
from django.shortcuts import render, get_object_or_404
|
|
from .models import MindMap
|
|
|
|
|
|
def mindmap_list(request):
|
|
mindmaps = MindMap.objects.filter(mindmap_data__isnull=False).exclude(
|
|
mindmap_data={}
|
|
)
|
|
return render(request, "mindlist.html", {"mindmaps": mindmaps})
|
|
|
|
|
|
def mindmap_detail(request, slug):
|
|
mm = get_object_or_404(MindMap, slug=slug)
|
|
return render(request, "minddetail.html", {"mindmap": mm}) |