volpe/_includes/base.njk

211 lines
No EOL
8 KiB
Text

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Volpe{% if title %} | {{ title }}{% endif %}</title>
{% if description %}
<meta name="description" content="{{ description }}">
{% endif %}
<style>
:root {
/* Text hierarchy */
--color-text-primary: #333;
--color-text-heading: #2c3e50;
--color-text-muted: #666;
--color-text-link: #3498db;
/* Backgrounds */
--color-bg-page: #fff;
--color-bg-surface: #f5f5f5;
--color-bg-warning: #fff3cd;
/* Borders & Dividers */
--color-border-default: #ddd;
--color-border-warning: #ffc107;
--color-border-focus: #3498db;
/* Feedback */
--color-warning-text: #856404;
/* Effects */
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
/* Spacing */
--space-section: 2rem;
--space-block: 1.5rem;
--space-element: 1rem;
--space-tight: 0.5rem;
--space-micro: 0.25rem;
/* Typography - Sizes */
--font-size-page-title: 2rem;
--font-size-section-title: 1.5rem;
--font-size-subsection-title: 1.25rem;
--font-size-nav: 1.2rem;
--font-size-body: 1rem;
--font-size-small: 0.9rem;
/* Typography - Weights */
--font-weight-normal: 400;
--font-weight-medium: 500;
--font-weight-bold: 700;
/* Typography - Line heights */
--line-height-body: 1.6;
/* Border Radius */
--radius-card: 8px;
--radius-block: 5px;
--radius-inline: 3px;
/* Legend/Diagram Colors */
--color-legend-1: #db2777;
--color-legend-2: #2563eb;
--color-legend-3: #0891b2;
--color-legend-4: #16a34a;
--color-legend-5: #dc2626;
--color-legend-6: #9333ea;
--color-legend-7: #ca8a04;
}
@media (prefers-color-scheme: dark) {
:root {
--color-text-primary: #e0e0e0;
--color-text-heading: #f0f0f0;
--color-text-muted: #a0a0a0;
--color-text-link: #5dade2;
--color-bg-page: #1a1a1a;
--color-bg-surface: #2d2d2d;
--color-bg-warning: #3d3520;
--color-border-default: #404040;
--color-border-warning: #ffc107;
--color-border-focus: #5dade2;
--color-warning-text: #ffd966;
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
--color-legend-1: #f472b6;
--color-legend-2: #60a5fa;
--color-legend-3: #22d3ee;
--color-legend-4: #4ade80;
--color-legend-5: #f87171;
--color-legend-6: #c084fc;
--color-legend-7: #fbbf24;
}
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
line-height: var(--line-height-body);
color: var(--color-text-primary);
background-color: var(--color-bg-page);
max-width: 800px;
margin: 0 auto;
padding: var(--space-section);
}
header { margin-bottom: var(--space-section); padding-bottom: var(--space-element); border-bottom: 1px solid var(--color-border-default); }
header nav { display: flex; justify-content: space-between; align-items: center; }
header nav a { color: var(--color-text-heading); text-decoration: none; font-weight: var(--font-weight-bold); font-size: var(--font-size-nav); }
main { min-height: calc(100vh - 200px); }
h1, h2, h3 { color: var(--color-text-heading); margin: 1.5rem 0 1rem; }
h1 { font-size: var(--font-size-page-title); }
footer { margin-top: var(--space-section); padding-top: var(--space-element); border-top: 1px solid var(--color-border-default); text-align: center; color: var(--color-text-muted); font-size: var(--font-size-small); }
footer > div {
display: flex;
justify-content: space-evenly;
}
footer a { color: var(--color-text-link); }
.icon-invertible { transition: filter 0.2s; }
@media (prefers-color-scheme: dark) {
.icon-invertible { filter: invert(1) brightness(0.9); }
}
</style>
{# Preload full stylesheet with cache-busted filename #}
<link rel="preload" href="{{ 'style.css' | fileHash }}" as="style">
<link rel="stylesheet" href="{{ 'style.css' | fileHash }}">
{# Defer prism.css - only needed for syntax highlighting #}
<link rel="preload" href="{{ 'prism.css' | fileHash }}" as="style">
<link rel="stylesheet" href="{{ 'prism.css' | fileHash }}" media="print" onload="this.media='all'">
<noscript><link rel="stylesheet" href="{{ 'prism.css' | fileHash }}"></noscript>
</head>
<body>
<header>
<nav>
<a href="/">Home</a>
{% if pageType == 'post' %}
<a href="/posts/">All Posts</a>
{% elif pageType == 'recipe' %}
<a href="/recipes/">All Recipes</a>
{% endif %}
</nav>
</header>
<main>
{{ content | safe }}
</main>
{% if mermaid %}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
{% endif %}
<script>
document.querySelectorAll('.localizable-time').forEach(function(el) {
var iso = el.getAttribute('datetime');
if (!iso) return;
try {
var date = new Date(iso);
if (isNaN(date.getTime())) return;
var options = {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
timeZoneName: 'short'
};
el.textContent = date.toLocaleString(undefined, options);
} catch (e) {
// Keep server-rendered fallback on error
}
});
</script>
<footer>
<div>
<!-- Social Things -->
<span>
<a href="https://matrix.to/#/@jan-leila:cyberia.club" title="Matrix" style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'matrix-icon-dark.svg' | fileHash('assets') }}" alt="Matrix Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</a>
<a href="https://git.jan-leila.com/jan-leila" title="Forgejo" style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'forgejo-icon-dark.svg' | fileHash('assets') }}" alt="Forgejo Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</a>
<a href="https://mspsocial.net/@jan_leila" title="Mastodon" style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'mastodon-icon-dark.svg' | fileHash('assets') }}" alt="Mastodon Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</a>
</span>
<span>
<a href="https://cyberia.click/prev.cgi?source=lambda"><- prev</a>
<a href="https://cyberia.click">cyberia webring</a>
<a href="https://cyberia.click/next.cgi?source=lambda">next -></a>
</span>
</div>
<!-- About site itself -->
<div>
<a href="https://git.jan-leila.com/jan-leila/volpe" style="display: flex;">
<span style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'git-icon-dark.svg' | fileHash('assets') }}" alt="Git Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</span>
source
</a>
<a href="/feed.xml" style="display: flex;">
<span style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'rss-icon-dark.svg' | fileHash('assets') }}" alt="RSS Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</span>
rss
</a>
<a href="http://2ggpzgonqsll5gi56u47aywu4qyl37eiu5jjrq7ma43z77ekkwuqxmid.onion" style="display: flex;">
<span style="display: inline-block; width: 24px; height: 24px; margin: 0 8px;">
<img src="{{ 'onion-icon-dark.svg' | fileHash('assets') }}" alt="Tor Onion Logo" class="icon-invertible" style="width: 100%; height: 100%;">
</span>
onion mirror
</a>
<span>&copy; {{ page.date.getFullYear() }} Volpe</span>
</div>
</footer>
</body>
</html>