Generate single page versions of series

This commit is contained in:
cheddar 2025-04-18 14:23:45 -04:00
parent 111c859aee
commit 00b535a618
No known key found for this signature in database
5 changed files with 53 additions and 5 deletions

View file

@ -2,7 +2,7 @@
layout: layouts/base.njk
---
<article>
<h1>{{ title }}</h1>
<h1 class="post-title">{{ title }}</h1>
<div class="about">
<address>by <a href="{{ author.url or metadata.author.url }}">
{{ author.name or metadata.author.name }}

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
{% if title %}{{ title }} - {% endif %}
{% if series %}{{ series.name }} - {% endif %}
{{ metadata.title }}
</title>
<meta name="description" content="{{ description or metadata.description }}">
<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
{{ content | safe }}
</body>
</html>

View file

@ -1,5 +1,6 @@
<nav>
<h2>{{ seriesName }}</h2>
<a href="/series/{{ seriesName | slugify }}/">View on one page</a>
<ol>
{%- for post in collections.posts | seriesPosts(seriesName) %}
{% include "post_link.njk" %}

View file

@ -24,19 +24,23 @@ ol {
}
hr {
margin: 20px 0 0 0;
margin: 10px 0;
}
article {
padding-bottom: 20px;
padding-bottom: 10px;
}
article > h1 {
article > .post-title {
margin-bottom: 0;
}
nav {
padding: 10px 0;
}
nav > h2 {
margin-bottom: 0;
margin: 0;
}
nav > ul {

25
content/series_pages.njk Normal file
View file

@ -0,0 +1,25 @@
---
layout: layouts/series_base.njk
pagination:
data: collections.series
size: 1
alias: seriesName
permalink: "series/{{ seriesName | slugify }}/"
---
<article>
<h1>{{ seriesName }}</h1>
{%- for post in collections.posts | seriesPosts(seriesName) %}
<article>
<h2 class="post-title">{{ post.data.title }}</h2>
<div class="about">
<address>by <a href="{{ post.author.url or metadata.author.url }}">
{{ post.author.name or metadata.author.name }}
</a></address>
<time datetime="{{ post.date | htmlDateString }}">published {{ post.date | readableDate }}</time>
</div>
{{ post.content | safe }}
</article>
<hr>
{%- endfor %}
</article>