diff --git a/pelicanconf.py b/pelicanconf.py index 73be9ab..57b2fc8 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -77,7 +77,7 @@ THEME = "theme" MENUITEMS = [ ("posts", ""), - ("projects", "projects.html"), + ("series", "series.html"), ("about", "about.html"), ] diff --git a/requirements.txt b/requirements.txt index 15a2fa5..5f22a11 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ livereload==2.7.1 Markdown==3.7 pelican==4.11.0 pelican-neighbors==1.2.0 +pelican-series==3.0.0 pelican-sitemap==1.2.0 pelican-statistics==1.0.0 pelican-webassets==2.1.0 diff --git a/theme/css/main.css b/theme/css/main.css index 86ad17e..89a312c 100644 --- a/theme/css/main.css +++ b/theme/css/main.css @@ -200,6 +200,30 @@ footer { @apply font-mono text-lg text-zinc-400; } +.article-series { + @apply italic my-8; + + .series-name { + @apply font-bold; + } + + ol { + @apply list-decimal list-inside; + + li { + @apply not-italic; + + &::marker { + @apply font-mono; + } + + span { + @apply text-zinc-400; + } + } + } +} + article { @apply font-light mt-8 text-lg; diff --git a/theme/templates/article.html b/theme/templates/article.html index 42a8e79..ba9fea2 100644 --- a/theme/templates/article.html +++ b/theme/templates/article.html @@ -38,6 +38,23 @@
+{% if article.series %} +
+

This article is part {{ article.series.index }} of the {{ article.series.name }} series:

+
    + {% for part_article in article.series.all %} +
  1. + {% if part_article == article %} + {{ part_article.title }} + {% else %} + {{ part_article.title }} + {% endif %} +
  2. + {% endfor %} +
+
+{% endif %} + {{ article.content }}
diff --git a/theme/templates/series.html b/theme/templates/series.html new file mode 100644 index 0000000..800c1bc --- /dev/null +++ b/theme/templates/series.html @@ -0,0 +1,30 @@ +{% extends "partials/_base.html" %} + +{# Page title: #} +{% block title %}{{ page.title|lower }} | {{ SITENAME|lower }}{% endblock %} + +{# Page metadata: #} +{% block meta %} + + +{% endblock %} + +{# Page content: #} +{% block content %} +

{{ page.title }}

+ +{% for series_name, series_articles in article_series|items %} +

{{ series_name }}

+ +{% endfor %} + +{% endblock content %}