feat(public): 首页分类移至左侧侧栏 + 大屏自适应布局

- 分类导航由顶部横条改为左侧 sticky 侧栏(≥1025px),含快速导航/我常访问/热门/书签分类/站点页面
- 首页左右去留白:.container 与 .topbar-inner 改为 max-width:100%,布局铺满视口
- 卡片网格按屏宽自适应(minmax(var(--card-min),1fr)),1920 固定 6 列
- 移除顶部 .actions 菜单(与侧栏站点页面重复),主题切换改由侧栏按钮循环切换
- 新增 get_nav_categories() 统一锚点(侧栏/顶部/抽屉/section id 四者同源),修复空分类错位;后台分类增删改/启停后失效前台缓存
This commit is contained in:
2026-09-07 11:11:22 +08:00
parent 1a33648b9a
commit 4d6325c70e
5 changed files with 406 additions and 71 deletions
@@ -15,3 +15,12 @@ def init_template_directives(app):
def csrf_input():
return f'<input type="hidden" name="csrf_token" value="{generate_csrf()}">'
@app.template_global()
def nav_categories():
"""前台左侧侧栏 / 移动端抽屉共用的分类列表(带 anchor 锚点)。
以函数形式提供而非 context_processor,后台模板不调用就不会查库。
"""
from applications.view.public.nav import get_nav_categories
return get_nav_categories()