lix.systems/templates/base.html
2024-03-12 16:52:10 -07:00

86 lines
3.5 KiB
HTML

{%- if section -%}
{#- Zola's `section` and `page` variables share many fields, so we set `page`
to whichever one is present and access common fields through that variable to
simplify templating. -#}
{%- set page = section -%}
{%- endif -%}
{%- if not page -%}
{#- Hack: Zola's 404.html doesn't get rendered with `page` or `section` set to
anything. -#}
{%- set page = get_page(path="404.md") -%}
{%- endif -%}
<!doctype html>
<html lang=en-US>
<meta charset=utf-8>
<!-- *lix you* OwO -->
<title>{% if page.title %}{{ page.title }} @ {% endif %}{{ config.title }}</title>
<meta name=description content="{{ page.description|default(value=config.description) }}">
<meta name=viewport content="width=device-width, initial-scale=1">
<link rel=icon href=/favicon.ico sizes=48x48>
<link rel=icon href=/favicon.svg sizes=any type=image/svg+xml>
<link rel=apple-touch-icon href=/apple-touch-icon.png />
<link rel=manifest href=/manifest.json>
<meta property=og:title content="{{ page.title }}">
<meta property=og:description content="{{ page.description|default(value=config.description) }}">
<meta property=og:type content=article>
<meta property=og:url content="{{ page.permalink|safe }}">
<meta property=og:image content="{{ config.base_url|safe }}/img/favicon-1024.png">
<meta name=theme-color content=#D362A4>
<link rel=stylesheet type=text/css href=/styles/main.css>
<div id=container>
<header>
<a aria-label="Skip to main content" href="#main"></a>
<nav>
<ul>
<li><a href="/" aria-label="Homepage">{{ config.title }}</a></li>
<li><a href="/about">about</a></li>
<li><a href="/doc" aria-label="Documentation">docs</a></li>
<li><a href="/contribute">contribute</a></li>
<li><a href="/install">install</a></li>
<li><a href="/switch">switch from Nix</a></li>
</ul>
</nav>
</header>
<main id=main>
{{ page.content|safe }}
{% block post_content %}{% endblock -%}
{%- if section.subsections or section.pages -%}
{% block ls_title -%}
{#- <h1>further reading</h1> -#}
{%- endblock %}
<ul>
{%- endif %}
{% block ls -%}
{%- if section.subsections -%}
{% for subsection_path in section.subsections %}
{%- set subsection = get_section(path=subsection_path, metadata_only=true) %}
<li><a href="{{ subsection.permalink | safe }}">{{ subsection.title }}</a>
{%- if subsection.description -%}
: <span class=description>{{ subsection.description }}</span>
{%- endif -%}
{%- if subsection.date -%}
: <span class=date>{{ subsection.date }}</span>
{%- endif -%}
</li>
{% endfor %}
{%- endif %}
{%- if section.pages -%}
{% for subsection in section.pages %}
{% if subsection.extra.hidden %}{% continue %}{% endif -%}
<li><a href="{{ subsection.permalink | safe }}">{{ subsection.title }}</a>
{%- if subsection.description -%}
: <span class=description>{{ subsection.description }}</span>
{%- endif -%}
{%- if subsection.date %}
<span class=date>({{ subsection.date }})</span>
{%- endif -%}
</li>
{% endfor %}
{%- endif %}
{%- if section.subsections or section.pages -%}
</ul>
{%- endif %}
{%- endblock %}
</main>
</div>