-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #234 * Implemented basic functionality to group posts by a series * Added two example posts to display how the series work * Updated the ReadMe to include how to setup the series Co-authored-by: Alexander Bilz <mail@alexbilz.com>
- Loading branch information
Showing
6 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
author: Hugo Authors | ||
title: Series Part 1 | ||
date: 2021-08-14 | ||
description: A brief guide to how to setup series part 1 | ||
series: | ||
- series-setup | ||
--- | ||
|
||
In this first part of the series we'll show you how to create a series | ||
|
||
<!--more--> | ||
|
||
As a first step we need to add series as a taxonomy. We can do this by editing the `config.toml`. | ||
Note: We always need to define the existing taxonomies as well. | ||
|
||
```toml | ||
[taxonomies] | ||
category = "categories" | ||
series = "series" | ||
tag = "tags" | ||
``` | ||
|
||
Now we have the series enabled, the next thing we need to do is add the series name in the FrontMatter. | ||
For our example we'll use this post and the next part. | ||
|
||
As you can see we've set the series to `series-setup`. We also do the same in the next parts of the series. | ||
This end results should be a Front Matter that looks similar to this: | ||
|
||
```md | ||
--- | ||
author: Hugo Authors | ||
title: Series Part 1 | ||
date: 2021-08-14 | ||
description: A brief guide to how to setup series part 1 | ||
series: | ||
- series-setup | ||
--- | ||
``` | ||
|
||
Each individual post will now also show the other posts in the series under the `Posts in this Series` heading. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
author: Hugo Authors | ||
title: Series Part 2 | ||
date: 2021-08-15 | ||
description: A brief guide to how to setup series part 2 | ||
series: | ||
- series-setup | ||
--- | ||
|
||
In this second part of the series we'll show you where to find the full series | ||
|
||
<!--more--> | ||
|
||
When you created a series, you'll probably want to link to the full set of blogposts. | ||
In this example we used `series-setup` as our series name. | ||
|
||
This means we can now go to `http://localhost:1313/series/series-setup/` to see all the blog posts of this serie. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{ $related := where .Site.RegularPages ".Params.series" "intersect" .Params.series }} | ||
|
||
|
||
<h3>Posts in this Series</h3> | ||
<ul> | ||
{{ range $related }} | ||
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></li> | ||
|
||
{{ end }} | ||
</ul> |