Migrate from Bazel

This commit is contained in:
Marc Plano-Lesay 2025-12-12 15:30:04 +11:00
commit 016dbd0814
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
59 changed files with 7044 additions and 0 deletions

View file

@ -0,0 +1,62 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ page.title }} · {{ config.title }}{% endblock title %}
{% block description %}{{ page.description | default(value=page.summary) | default(value=config.description) }}{% endblock description %}
{% block content %}
<article>
<header>
<h1 class="page-title">{{ page.title }}</h1>
{{ macros::post_meta(page=page) }}
{% if page.description %}
<p class="post-description">{{ page.description }}</p>
{% endif %}
</header>
{% set path_parts = page.relative_path | split(pat="/") %}
{% if path_parts | length > 2 %}
{% set parent_dir = path_parts | slice(end=-2) | join(sep="/") %}
{% set parent_section = get_section(path=parent_dir ~ "/_index.md") %}
{% if parent_section and parent_section.extra.series %}
<aside class="series-info">
<div class="series-info__header">
<strong>Part of the series:</strong> <a href="{{ parent_section.permalink }}">{{ parent_section.title }}</a>
</div>
<nav class="series-info__nav" aria-label="Series navigation">
<ol>
{% for p in parent_section.pages %}
<li {% if p.permalink == page.permalink %}class="current"{% endif %}>
<a href="{{ p.permalink }}" {% if p.permalink == page.permalink %}aria-current="page"{% endif %}>{{ p.title }}</a>
</li>
{% endfor %}
</ol>
</nav>
</aside>
{% endif %}
{% endif %}
<div class="post-content">
{{ page.content | safe }}
</div>
</article>
{% if page.earlier or page.later %}
<nav class="post-navigation" aria-label="Post navigation">
{% if page.later %}
<div class="post-navigation__prev">
<span class="post-navigation__label">← Previous</span>
<a href="{{ page.later.permalink }}">{{ page.later.title }}</a>
</div>
{% endif %}
{% if page.earlier %}
<div class="post-navigation__next">
<span class="post-navigation__label">Next →</span>
<a href="{{ page.earlier.permalink }}">{{ page.earlier.title }}</a>
</div>
{% endif %}
</nav>
{% endif %}
{% endblock content %}

View file

@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="{{ lang | default(value='en') }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
<meta name="description" content="{% block description %}{{ config.description }}{% endblock description %}">
<meta name="author" content="{{ config.author | default(value='') }}">
<link rel="icon" type="image/svg+xml" href="{{ get_url(path='favicon.svg', trailing_slash=false) }}">
{% if config.generate_feeds %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path='atom.xml', trailing_slash=false) }}">
{% endif %}
<link rel="stylesheet" href="{{ get_url(path='style.css', trailing_slash=false) }}">
{% block extra_head %}{% endblock extra_head %}
{% if config.extra.mermaid %}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
mermaid.initialize({
startOnLoad: true,
theme: 'base',
themeVariables: isDark ? {
primaryColor: '#88c0d0', primaryTextColor: '#d8dee9', primaryBorderColor: '#5e81ac',
lineColor: '#d08770', secondaryColor: '#81a1c1', tertiaryColor: '#b48ead',
background: '#2e3440', mainBkg: '#3b4252', secondBkg: '#434c5e', tertiaryBkg: '#4c566a',
textColor: '#d8dee9', border1: '#4c566a', border2: '#434c5e',
note: '#ebcb8b', noteBorder: '#d08770', noteBkg: '#5e81ac'
} : {
primaryColor: '#62a0d8', primaryTextColor: '#2e3440', primaryBorderColor: '#4271ae',
lineColor: '#d2a256', secondaryColor: '#d2a256', tertiaryColor: '#b48ead',
background: '#ffffff', mainBkg: '#f5f5f5', secondBkg: '#e8e8e8', tertiaryBkg: '#d8d8d8',
textColor: '#2e3440', border1: '#cccccc', border2: '#d8d8d8',
note: '#d2a256', noteBorder: '#d2a256', noteBkg: '#f5f5f5'
}
});
</script>
{% endif %}
{% if config.extra.analytics.service == "plausible" %}
<script defer data-domain="{{ config.extra.analytics.id }}" src="{{ config.extra.analytics.self_hosted_url }}/js/script.js"></script>
{% endif %}
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('pre code').forEach(function(code) {
const lines = code.textContent.split('\n');
const lineCount = lines[lines.length - 1] === '' ? lines.length - 1 : lines.length;
const lineNumbers = document.createElement('div');
lineNumbers.className = 'line-numbers';
lineNumbers.setAttribute('aria-hidden', 'true');
for (let i = 1; i <= lineCount; i++) {
lineNumbers.textContent += i + '\n';
}
code.parentElement.insertBefore(lineNumbers, code);
});
});
</script>
</head>
<body>
<header class="site-header">
<div class="container">
{% block header_nav %}
<nav aria-label="Main navigation">
<ul>
<li><a href="{{ get_url(path='posts', trailing_slash=true) }}" {% if current_path is starting_with('/posts') %}aria-current="page"{% endif %}>Blog</a></li>
{% for link in config.extra.nav_links | default(value=[]) %}
<li><a href="{{ link.url }}" {% if current_path is starting_with(link.url) and link.url != '/' %}aria-current="page"{% endif %}>{{ link.name }}</a></li>
{% endfor %}
</ul>
</nav>
<div class="header-bio">
<div class="header-bio__photo">
<picture>
<source srcset="{{ get_url(path='images/me.webp') }}" type="image/webp">
<img src="{{ get_url(path='images/me.jpg') }}" alt="{{ config.author }}">
</picture>
</div>
<div class="header-bio__info">
<div class="header-bio__main">
<div class="header-bio__name">{{ config.author }}</div>
{% if config.extra.bio %}
<div class="header-bio__text">{{ config.extra.bio }}</div>
{% endif %}
</div>
<div class="header-bio__socials">
{% for social in config.extra.socials %}
<a href="{{ social.url }}" rel="me" aria-label="{{ social.name | capitalize }}">
{% if social.icon == "github" %}
<svg viewBox="0 0 24 24" width="20" height="20"><path fill="currentColor" d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
{% elif social.icon == "mastodon" %}
<svg viewBox="0 0 24 24" width="20" height="20"><path fill="currentColor" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"/></svg>
{% elif social.icon == "twitter" %}
<svg viewBox="0 0 24 24" width="20" height="20"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
{% elif social.icon == "forgejo" %}
<svg viewBox="0 0 212 212" width="20" height="20">
<g transform="translate(6,6)" stroke="currentColor" fill="none">
<path d="M58 168 v-98 a50 50 0 0 1 50-50 h20" stroke-width="25"/>
<path d="M58 168 v-30 a50 50 0 0 1 50-50 h20" stroke-width="25"/>
<circle cx="142" cy="20" r="18" stroke-width="15"/>
<circle cx="142" cy="88" r="18" stroke-width="15"/>
<circle cx="58" cy="180" r="18" stroke-width="15"/>
</g>
</svg>
{% endif %}
</a>
{% endfor %}
{% if config.generate_feeds %}
<a href="{{ get_url(path='atom.xml', trailing_slash=false) }}" aria-label="RSS Feed">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5">
<circle cx="5" cy="19" r="2" fill="currentColor" stroke="none"/>
<path d="M4 11a9 9 0 0 1 9 9"/>
<path d="M4 4a16 16 0 0 1 16 16"/>
</svg>
</a>
{% endif %}
</div>
</div>
</div>
{% endblock header_nav %}
</div>
</header>
<main>
<div class="container">
{% block content %}{% endblock content %}
</div>
</main>
</body>
</html>

View file

@ -0,0 +1,37 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block content %}
<h1 class="page-title">Blog</h1>
{% if section.description %}
<p class="section-description">{{ section.description }}</p>
{% endif %}
<ul class="post-list">
{% if paginator %}
{% for page in paginator.pages %}
{{ macros::post_list_item(page=page) }}
{% endfor %}
{% else %}
{% set posts_section = get_section(path="posts/_index.md") %}
{% for page in posts_section.pages %}
{{ macros::post_list_item(page=page) }}
{% endfor %}
{% endif %}
</ul>
{% if paginator %}
<nav class="pagination" aria-label="Pagination">
{% if paginator.previous %}
<a href="{{ paginator.previous }}" rel="prev" class="pagination__button">Newer posts</a>
{% endif %}
<span class="pagination__info">Page {{ paginator.current_index }} of {{ paginator.number_pagers }}</span>
{% if paginator.next %}
<a href="{{ paginator.next }}" rel="next" class="pagination__button">Older posts</a>
{% endif %}
</nav>
{% endif %}
{% endblock content %}

View file

@ -0,0 +1,59 @@
{% macro post_list_item(page, show_tags=true, show_series=true) %}
<li class="post-list__item">
<h2 class="post-list__title">
<a href="{{ page.permalink }}">{{ page.title }}</a>
</h2>
{% if show_series %}
{% set path_parts = page.relative_path | split(pat="/") %}
{% if path_parts | length > 2 %}
{% set parent_dir = path_parts | slice(end=-2) | join(sep="/") %}
{% set parent_section = get_section(path=parent_dir ~ "/_index.md") %}
{% if parent_section and parent_section.extra.series %}
<p class="post-list__series">Part of the series: <a href="{{ parent_section.permalink }}">{{ parent_section.title }}</a></p>
{% endif %}
{% endif %}
{% endif %}
<div class="post-list__meta">
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d, %Y") }}</time>
{% if page.reading_time %}
<span aria-hidden="true">&middot;</span>
<span>{{ page.reading_time }} min read</span>
{% endif %}
{% if show_tags and page.taxonomies.tags %}
<span aria-hidden="true">&middot;</span>
<ul class="post-list__tags">
{% for tag in page.taxonomies.tags %}
<li><a href="{{ get_taxonomy_url(kind='tags', name=tag) }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% if page.description %}
<p class="post-list__description">{{ page.description }}</p>
{% endif %}
</li>
{% endmacro %}
{% macro post_meta(page, show_tags=true) %}
<div class="post-meta">
<time datetime="{{ page.date }}">{{ page.date | date(format="%B %d, %Y") }}</time>
{% if page.reading_time %}
<span aria-hidden="true">&middot;</span>
<span>{{ page.reading_time }} min read</span>
{% endif %}
{% if show_tags and page.taxonomies.tags %}
<span aria-hidden="true">&middot;</span>
<ul class="post-meta__tags">
{% for tag in page.taxonomies.tags %}
<li><a href="{{ get_taxonomy_url(kind='tags', name=tag) }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endmacro %}

View file

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% block title %}{{ page.title }} &middot; {{ config.title }}{% endblock title %}
{% block description %}{{ page.description | default(value=page.summary) | default(value=config.description) }}{% endblock description %}
{% block content %}
<h1 class="page-title">{{ page.title }}</h1>
<div class="page-content">
{{ page.content | safe }}
</div>
{% endblock content %}

View file

@ -0,0 +1,37 @@
{% extends "base.html" %}
{% block title %}{{ section.title }} &middot; {{ config.title }}{% endblock title %}
{% block content %}
<h1 class="page-title">{{ section.title }}</h1>
{% if section.content %}
<div class="section-content">
{{ section.content | safe }}
</div>
{% endif %}
{% if section.pages %}
<ul class="post-list">
{% for page in section.pages %}
<li class="post-list__item">
<h2 class="post-list__title">
<a href="{{ page.permalink }}">{{ page.title }}</a>
</h2>
{% set path_parts = page.relative_path | split(pat="/") %}
{% if path_parts | length > 2 %}
{% set parent_dir = path_parts | slice(end=-2) | join(sep="/") %}
{% set parent_section = get_section(path=parent_dir ~ "/_index.md") %}
{% if parent_section and parent_section.extra.series %}
<p class="post-list__series">Part of the series: <a href="{{ parent_section.permalink }}">{{ parent_section.title }}</a></p>
{% endif %}
{% endif %}
{% if page.description %}
<p class="post-list__description">{{ page.description }}</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock content %}

View file

@ -0,0 +1,28 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} &middot; {{ config.title }}{% endblock title %}
{% block description %}{{ section.description | default(value=config.description) }}{% endblock description %}
{% block content %}
<h1 class="page-title">{{ section.title }}</h1>
{% if section.description %}
<p class="section-description">{{ section.description }}</p>
{% endif %}
{% if section.content %}
<div class="section-content">
{{ section.content | safe }}
</div>
{% endif %}
<nav aria-label="Series navigation">
<ol class="post-list">
{% for page in section.pages %}
{{ macros::post_list_item(page=page, show_series=false) }}
{% endfor %}
</ol>
</nav>
{% endblock content %}

View file

@ -0,0 +1,6 @@
<aside class="note note--{{ type | default(value='note') }}">
<div class="note__title">{{ title | default(value=type | default(value="note") | capitalize) }}</div>
<div class="note__content">
{{ body | markdown | safe }}
</div>
</aside>

View file

@ -0,0 +1 @@
<div class="code-block__filename">{{ body }}</div>

View file

@ -0,0 +1,4 @@
<figure>
<div class="mermaid">{{ body }}</div>
{% if caption %}<figcaption>{{ caption }}</figcaption>{% endif %}
</figure>

View file

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% block title %}{{ taxonomy.name | title }} &middot; {{ config.title }}{% endblock title %}
{% block content %}
<h1 class="page-title">{{ taxonomy.name | title }}</h1>
<ul class="taxonomy-list">
{% for term in terms %}
<li class="taxonomy-list__item">
<a href="{{ term.permalink }}">{{ term.name }}</a>
<span class="taxonomy-list__count">({{ term.pages | length }})</span>
</li>
{% endfor %}
</ul>
{% endblock content %}

View file

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ term.name }} &middot; {{ taxonomy.name | title }} &middot; {{ config.title }}{% endblock title %}
{% block content %}
<h1 class="page-title">{{ taxonomy.name | title }}: {{ term.name }}</h1>
<ul class="post-list">
{% for page in term.pages %}
{{ macros::post_list_item(page=page, show_tags=false) }}
{% endfor %}
</ul>
{% endblock content %}