added categories

This commit is contained in:
2026-02-28 19:09:53 +01:00
parent be47059b32
commit e9855ec6a1
15 changed files with 169 additions and 129 deletions

View File

@@ -3,18 +3,33 @@
{% block content %}
<h1>{{ title }}</h1>
<ol>
{% for file in files %}
<li>
<a href="./{{ file.filename }}">{{ file.title }}</a> -
<span class="local-date" data-timestamp="{{ file.datetime }}">
{{ file.datetime }}
</span>
</li>
{% endfor %}
</ol>
<div class="entry-list">
{% set last_category = "___INIT___" %}
<hr />
{% for file in files %}
{% set current_cat = file.category | default(value="Uncategorized") %}
{# If file.category is None, we treat it as special top-level items #}
{% if not file.category %}
{# Just print the item, assuming sorted at top #}
<div class="entry-item">
<a href="./{{ file.filename }}">{{ file.title }}</a>
<span class="local-date" data-timestamp="{{ file.datetime }}">{{ file.datetime }}</span>
</div>
{% else %}
{# If it is a categorized item #}
{% if current_cat != last_category %}
<h3 class="category-header">{{ current_cat }}</h3>
{% set_global last_category = current_cat %}
{% endif %}
<div class="entry-item indent">
<a href="./{{ file.filename }}">{{ file.title }}</a>
<span class="local-date" data-timestamp="{{ file.datetime }}">{{ file.datetime }}</span>
</div>
{% endif %}
{% endfor %}
</div>
<h2>Recent Changes</h2>
{% if changelog | length > 0 %}

View File

@@ -2,7 +2,12 @@
{% block title %}{{ title }}{% endblock title %}
{% block content %}
<div class="wiki-header">
<h1>{{ title }}</h1>
<h1>
{{ title }}
{% if category %}
<span class="header-category">#{{ category }}</span>
{% endif %}
</h1>
</div>
<div class="wiki-container">

View File

@@ -241,3 +241,19 @@ nav a { font-weight: bold; font-size: 1.2rem; color: var(--text-main); }
font-family: 'JetBrains Mono', monospace;
}
.header-category {
font-size: 1.2rem;
color: var(--text-muted);
font-weight: normal;
margin-left: 15px;
vertical-align: middle;
opacity: 0.7;
}
.category-header {
margin-top: 2rem;
margin-bottom: 0.5rem;
border-bottom: 1px solid var(--border-color);
padding-bottom: 0.2rem;
}