Generate single page versions of series
This commit is contained in:
parent
111c859aee
commit
00b535a618
5 changed files with 53 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
||||||
layout: layouts/base.njk
|
layout: layouts/base.njk
|
||||||
---
|
---
|
||||||
<article>
|
<article>
|
||||||
<h1>{{ title }}</h1>
|
<h1 class="post-title">{{ title }}</h1>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<address>by <a href="{{ author.url or metadata.author.url }}">
|
<address>by <a href="{{ author.url or metadata.author.url }}">
|
||||||
{{ author.name or metadata.author.name }}
|
{{ author.name or metadata.author.name }}
|
||||||
|
|
18
_includes/layouts/series_base.njk
Normal file
18
_includes/layouts/series_base.njk
Normal 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>
|
|
@ -1,5 +1,6 @@
|
||||||
<nav>
|
<nav>
|
||||||
<h2>{{ seriesName }}</h2>
|
<h2>{{ seriesName }}</h2>
|
||||||
|
<a href="/series/{{ seriesName | slugify }}/">View on one page</a>
|
||||||
<ol>
|
<ol>
|
||||||
{%- for post in collections.posts | seriesPosts(seriesName) %}
|
{%- for post in collections.posts | seriesPosts(seriesName) %}
|
||||||
{% include "post_link.njk" %}
|
{% include "post_link.njk" %}
|
||||||
|
|
|
@ -24,19 +24,23 @@ ol {
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
margin: 20px 0 0 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
article {
|
article {
|
||||||
padding-bottom: 20px;
|
padding-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
article > h1 {
|
article > .post-title {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
nav > h2 {
|
nav > h2 {
|
||||||
margin-bottom: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav > ul {
|
nav > ul {
|
||||||
|
|
25
content/series_pages.njk
Normal file
25
content/series_pages.njk
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue