diff --git a/templates/public/base.html b/templates/public/base.html index 7599f72..a7b3ffa 100644 --- a/templates/public/base.html +++ b/templates/public/base.html @@ -2,68 +2,146 @@ - + + + {% block title %}{{ site_name|default('BWStudio · 导航') }}{% endblock %} + + {% block extra_head %}{% endblock %} @@ -136,18 +271,75 @@
🏠 首页 🔐 登录后台 +
+ {% block cat_nav %}{% endblock %} +
{% block content %}{% endblock %}
+ + {% block extra_js %}{% endblock %} + \ No newline at end of file diff --git a/templates/public/category.html b/templates/public/category.html index 226b31c..7673730 100644 --- a/templates/public/category.html +++ b/templates/public/category.html @@ -2,14 +2,21 @@ {% block title %}{{ category }} - {{ site_name }}{% endblock %} +{# 分类详情页只有一个分类,目录条也指向自己即可(避免空目录条) #} +{% block cat_nav %} + +{% endblock %} + {% block content %} -
+

{{ category }}

-
- 共 {{ items|length }} 个 · - ← 返回首页 -
+
共 {{ items|length }} 个
{% if not items %} @@ -24,10 +31,10 @@
-
{{ item.title }}
+
{{ item.title }}
{{ item.description or '暂无描述' }}
-
{{ item.url }}
+
{{ item.url }}
{% endfor %} diff --git a/templates/public/index.html b/templates/public/index.html index 4d554bc..2afd8e6 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -1,5 +1,18 @@ {% extends 'public/base.html' %} +{# 分类目录条(sticky 顶部导航) #} +{% block cat_nav %} +{% if groups %} + +{% endif %} +{% endblock %} + {% block content %} {% if not groups %}
@@ -8,7 +21,8 @@
{% else %} {% for category, items in groups.items() %} -
+ {% set cat_id = 'cat-' ~ loop.index %} +

{{ category }}

@@ -25,10 +39,10 @@
-
{{ item.title }}
+
{{ item.title }}
{{ item.description or '暂无描述' }}
-
{{ item.url }}
+
{{ item.url }}
{% endfor %}