Add Zola templates

This commit is contained in:
Nikita Karamov
2025-04-05 16:21:19 +02:00
committed by Vincent Breitmoser
parent 34b9b2733a
commit a44fbbed5e
5 changed files with 46 additions and 0 deletions

View File

@@ -9,3 +9,6 @@ base_url = "https://keys.openpgp.org"
generate_feeds = true
feed_filenames = ["atom.xml"]
[extra]
menu = [
]

19
templates/base.html Normal file
View File

@@ -0,0 +1,19 @@
<!doctype html>
<html lang="{{lang}}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="{{ get_url(path="site.css") }}?v=19" type="text/css">
<link rel="alternate" href="/atom.xml" type="application/atom+xml" title="keys.openpgp.org newsfeed" />
<title>{{config.title}}</title>
</head>
<body>
<div class="card">
<h1><a class="brand" href="/">{{config.title}}</a></h1>
{% block content %}{% endblock content %}
<div class="spacer"></div>
</div>
<div class="attribution">
<p>Background image retrieved from <a href="https://www.toptal.com/designers/subtlepatterns/subtle-grey/">Subtle Patterns</a> under CC BY-SA 3.0</p>
</div>
</body>

8
templates/page.html Normal file
View File

@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block content %}
<div class="about {%- if page %} {{ page.slug }}{%- endif -%}">
{% include "partials/menu.html" %}
{% if page %}{{ page.content | safe }}{% elif section %}{{ section.content | safe }}{% endif %}
</div>
{% endblock content %}

View File

@@ -0,0 +1,15 @@
<center><h2>
{%- for item in config.extra.menu -%}
{%- if item is ending_with("_index.md") -%}
{%- set item = get_section(path=item, metadata_only=true) -%}
{%- else -%}
{%- set item = get_page(path=item) -%}
{%- endif -%}
{% if not loop.first %} | {% endif -%}
{% if item.path == current_path -%}
{{ item.title }}
{%- else -%}
<a href="{{ item.permalink | safe }}">{{ item.title }}</a>
{%- endif %}
{% endfor %}</h2>
</center>

View File

@@ -0,0 +1 @@
<span class="brand">{{ name | default(value=config.title) }}</span>