Add FeedConfig and SitemapConfig structs to config.rs
with enabled: bool (default true) for opt-out control.
Refactor ConfigContext: flat nested_nav bool replaced
with nested nav: NavContext { nested, toc } to mirror
site.toml [nav] table structure.
Remove standalone base_url template variable; use
config.base_url as single source of truth with
trailing-slash trimming in ConfigContext::from().
Add section template fallback: try section/<type>.html,
fall back to section/default.html for unknown types.
Delete section/features.html (duplicate of default.html)
and homepage.html (dead code, never referenced).
Update base.html for new variable names.
67 lines
2.5 KiB
HTML
67 lines
2.5 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
{% if page.description %}
|
|
<meta name="description" content="{{ page.description }}" />{% endif %}
|
|
<title>{{ title }} | {{ config.title }}</title>
|
|
<link rel="canonical" href="{{ config.base_url }}{{ page_path }}" />
|
|
<link rel="stylesheet" href="{{ prefix }}/style.css" />
|
|
<link rel="icon" type="image/png" href="{{ prefix }}/logo.png" />
|
|
</head>
|
|
|
|
<body>
|
|
<aside class="sidebar">
|
|
<header>
|
|
<a href="{{ prefix }}/index.html" class="logo">
|
|
<img src="{{ prefix }}/logo.png" alt="" class="logo-img" />
|
|
sukr
|
|
</a>
|
|
<span class="tagline">suckless static sites</span>
|
|
<input type="checkbox" id="nav-toggle" class="nav-toggle" />
|
|
<label for="nav-toggle" class="hamburger" aria-label="Toggle navigation">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</label>
|
|
</header>
|
|
<nav>
|
|
{% for item in nav %}
|
|
{% set section_prefix = item.path | replace(from="index.html", to="") %}
|
|
{% set is_current_section = page_path is starting_with(section_prefix) %}
|
|
<a href="{{ prefix }}{{ item.path }}" {% if page_path==item.path %}class="active" {% endif %}>{{ item.label }}</a>
|
|
{% if page_path == item.path and page.toc and anchors %}
|
|
<div class="nav-anchors">
|
|
{% for anchor in anchors %}
|
|
<a href="#{{ anchor.id }}" class="anchor-link level-{{ anchor.level }}">{{ anchor.label | strip_parens }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% if config.nav.nested and item.children %}
|
|
<div class="nav-children{% if is_current_section %} expanded{% endif %}">
|
|
{% for child in item.children %}
|
|
<a href="{{ prefix }}{{ child.path }}" {% if page_path==child.path %}class="active" {% endif %}>{{ child.label
|
|
}}</a>
|
|
{% if page_path == child.path and page.toc and anchors %}
|
|
<div class="nav-anchors">
|
|
{% for anchor in anchors %}
|
|
<a href="#{{ anchor.id }}" class="anchor-link level-{{ anchor.level }}">{{ anchor.label | strip_parens }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</nav>
|
|
<footer class="sidebar-footer">
|
|
<a href="https://github.com/nrdxp/sukr">GitHub</a>
|
|
<span>© 2026 nrdxp — MIT</span>
|
|
</footer>
|
|
</aside>
|
|
<main>{% block content %}{% endblock content %}</main>
|
|
</body>
|
|
|
|
</html> |