feat: Adding series to the theme
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>
3 files added
3 files modified
| | |
| | | - Compliant to strict CSP |
| | | - Syntax highlighting |
| | | - Uses Hugo pipes to process assets |
| | | - Series |
| | | |
| | | ## Preview the exampleSite |
| | | |
| | |
| | | |
| | | Please note that only "## H2 Headings" and "### H3 Headings" will appear in the table of contents. |
| | | |
| | | ### Enabling Series |
| | | |
| | | You can enable series, which allows splitting up a huge post into a set of multiple blog posts that are still linked. This would also provide a unique link to the full series of blog posts. Each individual post in the series will also contain links to the other parts under the heading `Posts in this Series`. |
| | | |
| | | First, we need to enable the `series` taxonomy in the config. |
| | | |
| | | ```toml |
| | | [taxonomies] |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| | | ``` |
| | | |
| | | With this enabled, we can now proceed to specify the series in the Front Matter of each post of that series. |
| | | |
| | | ```md |
| | | series: - series-name |
| | | ``` |
| | | |
| | | If you want to share the full series, you can do so by sharing the link `<base-url>/series/<series-name>` |
| | | |
| | | ## License |
| | | |
| | | Anatole is licensed under the [MIT license](https://github.com/lxndrblz/anatole/blob/master/LICENSE). |
| | |
| | | [markup] |
| | | [markup.goldmark] |
| | | [markup.goldmark.renderer] |
| | | unsafe=true |
| | | unsafe=true |
| | | |
| | | [taxonomies] |
| | | category = "categories" |
| | | series = "series" |
| | | tag = "tags" |
| New file |
| | |
| | | --- |
| | | 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. |
| New file |
| | |
| | | --- |
| | | 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. |
| | |
| | | |
| | | {{ .Content }} |
| | | |
| | | {{- if isset .Params "series" -}} |
| | | {{- partial "series.html" . -}} |
| | | |
| | | {{- end -}} |
| | | |
| | | {{- if (eq .Params.contact true) -}} |
| | | {{- partial "contact.html" . -}} |
| | | |
| New file |
| | |
| | | {{ $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> |