加入「拾语」:首页 AI 近况摘要(流式)

- 汇总学习目录、博客分类与最近更新的 10 篇文章
- 调用本地 Ollama qwen3.8:27b 生成技术栈与最近在做
- 每次生成入库,10 天后首次打开首页自动重新生成
- 前端逐字展开缓存摘要,过期时读取 AI 流式响应
- 首页在开场引导结束后显示;拾脉目录页内嵌展示
- 修复摘要面板标题栏命中全局 header 定位的问题
This commit is contained in:
2026-11-21 13:56:53 +08:00
parent 7c6e5d45d1
commit e3270bcd94
19 changed files with 951 additions and 3 deletions
+5 -1
View File
@@ -4,6 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="csrf-token" content="{{ csrf_token }}">
<title>思维导航 · 我的博客</title>
<!-- <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> -->
@@ -13,6 +14,7 @@
<link href="https://fonts.loli.net/css2?family=Noto+Serif+SC:wght@500;700;900&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap" rel="stylesheet">
<!-- 全局基础样式(项目级) -->
<link rel="stylesheet" href="{% static 'blog/css/style.css' %}">
<link rel="stylesheet" href="{% static 'digest/digest.css' %}">
<!-- 让子模板可以追加自己的 CSS -->
{% block extra_css %}{% endblock %}
@@ -186,7 +188,8 @@
<span class="dot"></span>
<a class="footer-link" href="/manage/">写作台</a>
</footer>
{% include "digest/_panel.html" %}
<script src="{% static 'blog/js/d3.min.js' %}"></script>
<script src="{% static 'blog/js/index.js' %}"></script>
@@ -199,6 +202,7 @@
<script src="https://cdn.jsdmirror.com/npm/markmap-view@0.18.10/dist/browser/index.js"></script>
<script src="https://cdn.jsdmirror.com/npm/markmap-lib@0.18.12/dist/browser/index.iife.js"></script> -->
<script type="module" src="{% static 'blog/js/main.js' %}"></script>
<script src="{% static 'digest/digest.js' %}"></script>
<!-- 让子模板可以追加自己的 JS -->
{% block extra_js %}{% endblock %}
</body>
+8 -2
View File
@@ -8,6 +8,7 @@ from django.utils.html import strip_tags
from .models import Category, Post, Tag , SiteInfo
from explore.models import Idea, Repository
from mindmaps.models import MindMap
from digest.services import DIGEST_DAYS, DIGEST_MODEL, digest_is_stale, latest_digest
def category_list(request):
# """首页:展示所有分类"""
@@ -39,12 +40,17 @@ def category_list(request):
digest = latest_digest()
return render(request, 'base2.html', {
# 'categories': categories,
'total_posts': total_posts, # 文章总数
'total_categories': total_categories, # 分类总数
'mindmap_count' : mindmap_count
'mindmap_count' : mindmap_count,
'digest': digest,
'digest_stale': digest_is_stale(digest),
'digest_days': DIGEST_DAYS,
'digest_model': DIGEST_MODEL,
})