Discussion:
[hakyll] Making a blog series, how to add a "posts in series" link list into a post based on metadata?
j***@gmail.com
2018-05-22 08:20:49 UTC
Permalink
I'm making a series of blog posts on the same topic, and I'd like each post
in the series to a full list of all posts in that series.

I thought about specifying this like this:

in post:

----
title: ...
series: series-name-1
----

Then either in my post markdown or in my post.html template, I'd somehow
insert a list of all the blog posts that contain series-name-1. Something
like $series_links("series-name-1")$ or alternatively, the list generation
would look at the posts series tags (if set) and filter the list
automatically.

I realize this is a little bit like tags. I tried to adapt something
like https://stackoverflow.com/questions/35645525/hakyll-says-dependency-cycle-detected/35651294#35651294
to get a list of posts when I'm rendering a post. But I've somehow painted
myself into a corner with this approach and can't get it to work (my code
match rules seem to always match the "versioned" posts and not the
non-versioned posts).

Anyone have any tips on how to implement something like this on Hakyll?

Janne
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Janne Hellsten
2018-05-22 15:11:37 UTC
Permalink
I found a reasonably OK solution by just moving the "posts in this series"
into a separate template and then expanding it conditionally based on a
"series" metadata value using a functionField

In case someone is curious about it, you can view the change here:
https://github.com/nurpax/blog/commit/9a80803d81c8b8bcd348a437599e3e72316ef872

An automatic "list all posts with series=<some value>" would still be nice.

Janne
Post by j***@gmail.com
I'm making a series of blog posts on the same topic, and I'd like each
post in the series to a full list of all posts in that series.
----
title: ...
series: series-name-1
----
Then either in my post markdown or in my post.html template, I'd somehow
insert a list of all the blog posts that contain series-name-1. Something
like $series_links("series-name-1")$ or alternatively, the list
generation would look at the posts series tags (if set) and filter the list
automatically.
I realize this is a little bit like tags. I tried to adapt something like
https://stackoverflow.com/questions/35645525/hakyll-says-dependency-cycle-
detected/35651294#35651294 to get a list of posts when I'm rendering a
post. But I've somehow painted myself into a corner with this approach and
can't get it to work (my code match rules seem to always match the
"versioned" posts and not the non-versioned posts).
Anyone have any tips on how to implement something like this on Hakyll?
Janne
--
You received this message because you are subscribed to a topic in the
Google Groups "hakyll" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/hakyll/U3zKmOxXUwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...