1
0
Fork 0
forked from github/pelican

feat: yearly archives, restructure headings

This commit is contained in:
Oliver Ladner 2025-01-08 11:45:09 +01:00
commit 310fab5496
11 changed files with 120 additions and 19 deletions

View file

@ -4,13 +4,26 @@
{% block content %}
<div class="md:text-base lg:text-lg">
<h2>Blog archive</h2>
<h1 class="text-3xl md:text-5xl">Blog archive</h1>
<ul class="hyphens-auto list-outside list-disc">
<dl class="hyphens-auto">
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% for article in dates %}
{% set year = article.date.strftime('%Y') %}
{% if loop.first %}
<h2 class="text-2xl md:text-3xl mt-6 mb-2" id="{{year }}"><a href="#{{year}}">{{ year }}</a></h2>
{% else %}
{% set prevyear = loop.previtem.date.strftime('%Y') %}
{% if prevyear != year %}
<h2 class="text-2xl md:text-3xl mt-6 mb-2" id="{{year }}"><a href="#{{year}}">{{ year }}</a></h2>
{% endif %}
{% endif %}
{% set month = article.date.strftime('%m') %}
{% set day = article.date.strftime('%d') %}
<li>{{ article.locale_date }}: <a href="{{ SITEURL }}/{{ article.url }}#content">{{ article.title }}</a></li>
{%if article.subtitle %}
{{ article.subtitle }}
{% endif %}
{% endfor %}
</ul>
</div>
{% endblock %}

View file

@ -19,10 +19,10 @@
{% block content %}
<article class="prose dark:prose-dark md:prose-base lg:prose-lg prose-img:rounded hyphens-auto">
<header>
<h3 class="text-3xl md:text-5xl">
<h1 class="text-3xl md:text-5xl">
{{ article.title }}
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}" class="no-underline text-rp-dawn-overlay">#</a>
</h3>
</h1>
<ul class="list-none border-b-2 border-rp-dawn-overlay dark:border-rp-moon-overlay">
<li>
<span class="flex items-center">

View file

@ -3,5 +3,5 @@
{% block title %}{{ SITENAME|striptags }} - Articles by {{ author }}{% endblock %}
{% block content_title %}
<h2>Articles by {{ author }}</h2>
<h1 class="text-3xl md:text-5xl">Articles by {{ author }}</h1>
{% endblock %}

View file

@ -3,7 +3,7 @@
{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %}
{% block content %}
<h2>Authors on {{ SITENAME }}</h2>
<h1 class="text-3xl md:text-5xl">Authors on {{ SITENAME }}</h1>
<ul>
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>

View file

@ -4,7 +4,7 @@
{% block content %}
<div class="md:text-base lg:text-lg">
<h2>Blog categories</h2>
<h1 class="text-3xl md:text-5xl">Blog categories</h1>
<ul class="hyphens-auto">
{% for category, articles in categories|sort %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ articles|count }})</li>

View file

@ -3,5 +3,5 @@
{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %}
{% block content_title %}
<h2>Tales from the <em>{{ category }}</em> department</h2>
<h1 class="text-3xl md:text-5xl">Tales from the <em>{{ category }}</em> department</h1>
{% endblock %}

View file

@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}
<h2>Recent blog posts</h2>
<h1 class="text-3xl md: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">
@ -12,8 +12,8 @@
<time datetime="{{ article.date.isoformat() }}" class="italic">{{ article.locale_date }}</time>
</footer>
<header>
<h3 class="text-3xl mb-3 hyphens-auto"><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
</h3>
<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>

View file

@ -9,7 +9,7 @@
{% block content %}
<article>
<div class="prose dark:prose-dark md:prose-base lg:prose-lg hyphens-auto">
<h3 class="text-3xl md:text-5xl">{{ page.title }}</h3>
<h1 class="text-3xl md:text-5xl">{{ page.title }}</h1>
{{ page.content }}
</div>
</article>

View file

@ -3,5 +3,5 @@
{% block title %}{{ SITENAME|striptags }} - {{ tag }} tag{% endblock %}
{% block content_title %}
<h2>Tales tagged with <em>{{ tag }}</em></h2>
<h1 class="text-3xl md:text-5xl">Tales tagged with <em>{{ tag }}</em></h1>
{% endblock %}

View file

@ -3,7 +3,7 @@
{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %}
{% block content %}
<h2>Tags for {{ SITENAME }}</h2>
<h1 class="text-3xl md:text-5xl">Tags for {{ SITENAME }}</h1>
<ul>
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>