This commit is contained in:
2026-03-21 14:53:25 +00:00
commit 17f2462baf
42 changed files with 5986 additions and 0 deletions

62
templates/base.html Normal file
View File

@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="{{ config.language }}">
<head>
{% block head %}
<meta charset="UTF-8" />
{% if metadata.description and not metadata.description == "nil" %}
<meta name="description" content="{{ metadata.description }}" />
{% endif %}
{% if metadata.authors %}
<meta name="author" content="{{ config.author }}" />
{% endif %}
{% if metadata.categories %}
<meta name="keywords" content="{{ metadata.categories | join(sep=", ") }}" />
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{% if config.highlighter is defined and config.highlighter.enable %}
{# If highlighter is enabled but the engine is not defined then fallback to prismjs #}
{% if config.highlighter.engine is not string or config.highlighter.engine == "prism" %}
{# PrismJS #}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism-themes/1.9.0/prism-one-dark.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
{% elif config.highlighter.engine is defined
and config.highlighter.engine == "hljs" %}
{# Highlight.js #}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script> #}
{# Enable this one instead if you want all the `<code>` tags to be highlighted
<script>
document.addEventListener("DOMContentLoaded", (event) => {
document.querySelectorAll("code").forEach((block) => {
hljs.highlightBlock(block);
});
});
</script>
#}
{% elif config.highlighter.engine is string
and config.highlighter.engine not in ["prism", "hljs"] %}
<script>
window.alert("Warning: highlighter is enabled in the site configuration but its engine is not 'prism' nor 'hljs'");
</script>
{% endif %}
{% endif %}
{# User-defined styling #}
{# Tailwind CDN, replace with the Tailwind standalone CLI for production! #}
<script src="https://unpkg.com/@tailwindcss/browser@4"></script>
<link rel="stylesheet" href="/assets/style.css" />
<link rel="icon" href="/assets/norgolith.svg" />
<title>{% block title %}{% endblock title %} - {{ config.title | title }}</title>
{% endblock head %}
</head>
<body>
<div id="content">{% block content %}{% endblock content %}</div>
<div id="footer">
{% block footer %}
&copy; Copyright {{ now(format="%Y") }} by {{ config.author }}.
{% endblock footer %}
</div>
</body>
</html>