1
0
Fork 0
forked from github/pelican

feat: this is going live now

This commit is contained in:
Oliver Ladner 2024-12-19 09:56:25 +01:00
commit 06cac4589c
410 changed files with 4684 additions and 44715 deletions

16
templates/archives.html Normal file
View file

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %}
{% block content %}
<div class="md:text-base lg:text-lg">
<h2>Blog archive</h2>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
</div>
{% endblock %}

106
templates/article.html Normal file
View file

@ -0,0 +1,106 @@
{% extends "base.html" %}
{% block html_lang %}{{ article.lang }}{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ article.title|striptags }}{% endblock %}
{% block head %}
{{ super() }}
{% if article.description %}
<meta name="description" content="{{article.description}}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block content %}
<article class="prose dark:prose-dark md:prose-base lg:prose-lg prose-img:rounded hyphens-auto">
<header>
<h1 class="text-5xl">
{{ article.title }}</a>
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}" class="no-underline text-rp-dawn-overlay">#</a>
</h1>
<ul class="list-none border-b-2 border-rp-dawn-overlay dark:border-rp-moon-overlay">
<li>
<span class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5">
<path fill-rule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z" clip-rule="evenodd" />
</svg>
&nbsp;{{ article.stats['read_mins']*1.5|round|int }} min. read
</span>
<span class="flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5">
<path d="M10.75 16.82A7.462 7.462 0 0 1 15 15.5c.71 0 1.396.098 2.046.282A.75.75 0 0 0 18 15.06v-11a.75.75 0 0 0-.546-.721A9.006 9.006 0 0 0 15 3a8.963 8.963 0 0 0-4.25 1.065V16.82ZM9.25 4.065A8.963 8.963 0 0 0 5 3c-.85 0-1.673.118-2.454.339A.75.75 0 0 0 2 4.06v11a.75.75 0 0 0 .954.721A7.506 7.506 0 0 1 5 15.5c1.579 0 3.042.487 4.25 1.32V4.065Z" />
</svg>
&nbsp;<a href="https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests" target="_blank">Flesch-Kincaid reading ease</a>:&nbsp;<abbr title="0-30: very hard, 30-50: hard, 50-70: moderate-medium, 70-100: simple">{{ article.stats['fi']|int }}</abbr>
</span>
</li>
<li>
<time class="flex items-center" datetime="{{ article.date.isoformat() }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5">
<title>Publication date</title>
<path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" />
</svg>
&nbsp;{{ article.locale_date }}
</time>
{% if article.modified %}
<time class="flex items-center" datetime="{{ article.modified.isoformat() }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="size-5">
<title>Modification date</title>
<path fill-rule="evenodd" d="M10 4.5c1.215 0 2.417.055 3.604.162a.68.68 0 0 1 .615.597c.124 1.038.208 2.088.25 3.15l-1.689-1.69a.75.75 0 0 0-1.06 1.061l2.999 3a.75.75 0 0 0 1.06 0l3.001-3a.75.75 0 1 0-1.06-1.06l-1.748 1.747a41.31 41.31 0 0 0-.264-3.386 2.18 2.18 0 0 0-1.97-1.913 41.512 41.512 0 0 0-7.477 0 2.18 2.18 0 0 0-1.969 1.913 41.16 41.16 0 0 0-.16 1.61.75.75 0 1 0 1.495.12c.041-.52.093-1.038.154-1.552a.68.68 0 0 1 .615-.597A40.012 40.012 0 0 1 10 4.5ZM5.281 9.22a.75.75 0 0 0-1.06 0l-3.001 3a.75.75 0 1 0 1.06 1.06l1.748-1.747c.042 1.141.13 2.27.264 3.386a2.18 2.18 0 0 0 1.97 1.913 41.533 41.533 0 0 0 7.477 0 2.18 2.18 0 0 0 1.969-1.913c.064-.534.117-1.071.16-1.61a.75.75 0 1 0-1.495-.12c-.041.52-.093 1.037-.154 1.552a.68.68 0 0 1-.615.597 40.013 40.013 0 0 1-7.208 0 .68.68 0 0 1-.615-.597 39.785 39.785 0 0 1-.25-3.15l1.689 1.69a.75.75 0 0 0 1.06-1.061l-2.999-3Z" clip-rule="evenodd" />
</svg>
&nbsp;{{ article.locale_modified }}
</time>
{% endif %}
</li>
</ul>
{% if article.series %}
<div class="m-10 pl-4 bg-rp-dawn-overlay text-rp-dawn-text dark:bg-rp-moon-surface dark:text-rp-moon-text">
<p>This post is part {{ article.series.index }} of the "{{ article.series.name }}" series:
<ol class="parts">
{% for part_article in article.series.all %}
<li {% if part_article == article %}class="active"{% endif %}>
<a href='{{ SITEURL }}/{{ part_article.url }}'>{{ part_article.title }}</a>
</li>
{% endfor %}
</ol>
</div>
{% endif %}
</header>
{{ article.content }}
<!--<div class="grid grid-cols-3 font-tags text-xs p-5 border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay">-->
<div class="grid grid-cols-3 text-sm p-5 border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay">
<div class="col-span-1">
<!--Category: <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>-->
{% if article.category %}
<p>
Category
</p>
{% endif %}
{% if article.tags %}
<p>
Tags
</p>
{% endif %}
</div>
<div class="col-span-2">
{% if article.category %}
<p>
<a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
</p>
{% endif %}
{% if article.tags %}
<p>
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
{% endfor %}
</p>
{% endif %}
</div>
</div>
</article>
{% endblock %}

7
templates/author.html Normal file
View file

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME|striptags }} - Articles by {{ author }}{% endblock %}
{% block content_title %}
<h2>Articles by {{ author }}</h2>
{% endblock %}

12
templates/authors.html Normal file
View file

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %}
{% block content %}
<h2>Authors on {{ SITENAME }}</h2>
<ul>
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}

144
templates/base.html Normal file
View file

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}">
<head>
{% block head %}
<title>{% block title %}{{ SITENAME|striptags }}{% endblock title %}</title>
<meta charset="utf-8" />
<meta name="generator" content="Pelican" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if SITESUBTITLE %}
<meta name="description" content="{{ SITESUBTITLE }}" />
{% endif %}
{% if STYLESHEET_URL %}
<link rel="stylesheet" type="text/css" href="{{ STYLESHEET_URL }}" />
{% endif %}
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL.format(slug=category.slug) }}{% else %}{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_ATOM.format(slug=tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL.format(slug=tag.slug) }}{% else %}{{ TAG_FEED_RSS.format(slug=tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME|striptags }} Tags RSS Feed" />
{% endif %}
<link href="https://api.fontshare.com/v2/css?f[]=erode@400&f[]=fira-sans@600&display=swap" rel="stylesheet">
<script src="/theme/js/prism.js"></script>
<link rel="stylesheet" type="text/css" href="/theme/css/prism.css" />
<link rel="stylesheet" type="text/css" href="/theme/css/prism-rose-pine-moon-alt.css" />
<style>
code[class*="language-"],
pre[class*="language-"] {
/* Remove text shadow on prism.js code blocks
Probably caused by rose pine theme */
text-shadow: none;
/* Align prism.js font size to main font size */
font-size: 0.9rem;
}
</style>
{% endblock head %}
</head>
<body>
<div class="grid grid-cols-5">
<!--header-->
<div class="col-span-3 bg-rp-dawn-overlay dark:bg-rp-moon-overlay p-8">
<header>
<hgroup>
<h1 class="text-4xl md:text-7xl font-bold text-rp-dawn-foam"><a class="no-underline text-rp-dawn-pine dark:text-rp-moon-foam" href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
{% if SITESUBTITLE %}
<h2 class="text-xl md:text-2xl font-bold text-rp-dawn-text italic">{{ SITESUBTITLE }}</h2>
{% endif %}
</hgroup>
</header>
</div>
<div class="col-span-2">
<nav class="bg-rp-dawn-surface dark:bg-rp-moon-surface p-4 text-xl">
<ul class="list-none">
{% if DISPLAY_PAGES_ON_MENU %}
<div>
{% for p in pages %}
<li><a href="{{ SITEURL }}/{{ p.url }}" class="no-underline" {% if p==page %} aria-current="page" {% endif %}>{{ p.title }}</a></li>
{% endfor %}
</div>
{% endif %}
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}" class="no-underline">{{ title }}</a></li>
{% endfor %}
<div class="border-b-4 border-rp-dawn-overlay dark:border-rp-moon-overlay">
{% for title, link in LINKS %}
<li><a href="{{ link }}" class="no-underline">{{ title }}</a></li>
{% endfor %}
</div>
{% if DISPLAY_CATEGORIES_ON_MENU %}
<div>
{% for cat, null in categories %}
<li><a href="{{ SITEURL }}/{{ cat.url }}" class="no-underline" {% if cat==category %} aria-current="page" {% endif %}>{{ cat}}</a></li>
{% endfor %}
</div>
{% endif %}
</ul>
</nav>
</div>
<!--main-->
<div class="bg-rp-dawn-base dark:bg-rp-moon-base">
<!--Empty spacer-->
</div>
<div class="col-span-3 bg-rp-dawn-base dark:bg-rp-moon-base p-4">
<main>
{% block content %}
{% endblock %}
</main>
</div>
<div class="bg-rp-dawn-base dark:bg-rp-moon-base">
<!--Empty spacer-->
</div>
<!--footer-->
<div class="bg-rp-dawn-surface dark:bg-rp-moon-surface">
<!--Empty spacer-->
</div>
<div class="col-span-3 pt-20 pb-60 bg-rp-dawn-surface dark:bg-rp-moon-surface text-rp-dawn-text dark:text-rp-moon-rose">
<footer>
<div class="grid grid-cols-1 md:grid-cols-3">
<div class="col-span-2 p-5">
<p>
Generated by <a href="https://getpelican.com" target="_blank">Pelican</a> with a
<a href="https://arrakis.fly.dev/weeheavy/pelican-theme" target="_blank">bespoke</a> theme inspired by <a href="https://rosepinetheme.com" target="_blank">Rosé Pine</a>.
</p>
<p>
<a href="https://buymeacoffee.com/lugh" target="_blank">Buy me a coffee?</a>
</p>
</div>
<div class="p-5 md:border-l-4 border-rp-dawn-overlay dark:border-rp-moon-overlay">
<p>
<!--Valid <a href="https://wave.webaim.org/report#/https://lugh.ch" target="_blank">WCAG AAA</a>.-->
</p>
<p>
100% organic content licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display: inline-block">CC BY-SA 4.0</a>
</p>
<p>
<a href="/feeds/atom.xml" target="_blank">Atom feed</a>
</p>
</div>
</div>
</footer>
</div>
<div class="bg-rp-dawn-surface dark:bg-rp-moon-surface">
<!--Empty spacer-->
</div>
</div> <!-- end main grid -->
</body>
</html>

14
templates/categories.html Normal file
View file

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %}
{% block content %}
<div class="md:text-base lg:text-lg">
<h2>Categories</h2>
<ul>
{% for category, articles in categories|sort %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
</div>
{% endblock %}

7
templates/category.html Normal file
View file

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %}
{% block content_title %}
<h2>Tales from the <em>{{ category }}</em> department</h2>
{% endblock %}

27
templates/index.html Normal file
View file

@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}
<h1 class="text-5xl">Recent blog posts</h1>
{% endblock %}
<!--This needs to align to the PAGINATION value in pelicanconf.py-->
<div class="grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-8">
{% for article in articles_page.object_list %}
<div>
<article>
<footer>
<time datetime="{{ article.date.isoformat() }}" class="italic">{{ article.locale_date }}</time>
</footer>
<header>
<h2 class="text-3xl mb-3 hyphens-auto"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
</h2>
</header>
<section>{{ article.summary }}</section>
</article>
</div>
{% endfor %}
</div>
{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
{% endif %}
{% endblock content %}

24
templates/page.html Normal file
View file

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block html_lang %}{{ page.lang }}{% endblock %}
{% block title %}{{ SITENAME|striptags }} - {{ page.title|striptags }}{%endblock%}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<article>
<div class="prose dark:prose-dark md:prose-base lg:prose-lg hyphens-auto">
<h1 class="text-5xl">{{ page.title }}</h1>
{{ page.content }}
</div>
{% if page.modified %}
<footer>
<p>
</p>
</footer>
{% endif %}
</article>
{% endblock %}

46
templates/pagination.html Normal file
View file

@ -0,0 +1,46 @@
{% if DEFAULT_PAGINATION %} {% set first_page = articles_paginator.page(1) %} {%
set last_page = articles_paginator.page(articles_paginator.num_pages) %}
<nav class="flex justify-center items-center">
{% if articles_page.has_previous() %}
<ul class="list-none inline-grid grid-cols-[max-content_max-content_max-content_max-content_max-content] border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay m-4 p-4">
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-12">
<a
class="block no-underline hover:no-underline"
title="Go to the previous page"
href="{{ SITEURL }}/{{ articles_previous_page.url }}"
><tt>&laquo;</tt></a>
</li>
</span>
{% else %}
<!--If we are on the first page, there's no previous links, so reduce grid sizing-->
<ul class="list-none inline-grid grid-cols-[max-content_max-content_max-content] border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay m-4 p-4">
{% endif %}
<span class="p-1">
<li class="text-center">
Page {{ articles_page.number }} of {{ articles_paginator.num_pages }}
</li>
</span>
{% if articles_page.has_next() %}
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-8">
<a
class="block no-underline hover:no-underline"
href="{{ SITEURL }}/{{ articles_next_page.url }}"
title="Go to page {{ articles_page.next_page_number() }}"
>{{ articles_page.next_page_number() }}</a>
</li>
</span>
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-12">
<a
class="block no-underline hover:no-underline align-top"
href="{{ SITEURL }}/{{ articles_next_page.url }}"
title="Go to the next page"
><tt>&raquo;</tt></a>
</li>
</span>
{% endif %}
</ul>
</nav>
{% endif %}

View file

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME|striptags }} - {{ period | reverse | join(' ') }} archives{% endblock %}
{% block content %}
<h2>Archives for {{ period | reverse | join(' ') }}</h2>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}

7
templates/tag.html Normal file
View file

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME|striptags }} - {{ tag }} tag{% endblock %}
{% block content_title %}
<h2>Tales tagged with <em>{{ tag }}</em></h2>
{% endblock %}

12
templates/tags.html Normal file
View file

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %}
{% block content %}
<h2>Tags for {{ SITENAME }}</h2>
<ul>
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}