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:
@@ -34,15 +34,16 @@
|
||||
</a>
|
||||
{% endmacro %}
|
||||
|
||||
{# 分类目录条(sticky 顶部导航) #}
|
||||
{# 分类目录条:仅平板(601–1024px)可见,桌面走左侧侧栏、手机走抽屉 #}
|
||||
{% block cat_nav %}
|
||||
{% if groups or top_navs or my_navs %}
|
||||
{% set anchors = cat_anchors or {} %}
|
||||
<nav class="cat-nav" aria-label="分类导航">
|
||||
<div class="cat-nav-inner" id="cat-nav-inner">
|
||||
{% if my_navs %}<a href="#cat-mine" class="cat-nav-mine">★ 我常访问</a>{% endif %}
|
||||
{% if top_navs %}<a href="#cat-top" class="cat-nav-hot">🔥 热门网址</a>{% endif %}
|
||||
{% for category in groups.keys() %}
|
||||
<a href="#cat-{{ loop.index }}">{{ category }}</a>
|
||||
<a href="#{{ anchors.get(category) or ('cat-' ~ loop.index) }}">{{ category }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</nav>
|
||||
@@ -88,8 +89,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% for category, items in groups.items() %}
|
||||
{% set cat_id = 'cat-' ~ loop.index %}
|
||||
<section class="section" id="{{ cat_id }}">
|
||||
{# 锚点与左侧侧栏、顶部横条、移动端抽屉共用同一套 id #}
|
||||
{% set cat_id = (cat_anchors or {}).get(category) or ('cat-' ~ loop.index) %}
|
||||
<section class="section" id="{{ cat_id }}" data-cat="{{ category }}">
|
||||
<div class="section-header">
|
||||
<h2>{{ category }}</h2>
|
||||
<div class="meta">
|
||||
|
||||
Reference in New Issue
Block a user