Discussion:
[hakyll] Is there a way to create a single tags page?
j***@gmail.com
2018-03-10 14:48:01 UTC
Permalink
The tutorial here
<https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html>
has instructions for how to add tag pages to a Hakyll blog, i.e.,
`tags/tag1.html`, `tags/tag2.html`, etc. But is there a way to have a
single page with a list of tags, and a list of posts with each tag? I'm
basically trying to recreate this page <http://jonreeve.com/tags/> from my
Jekyll website where I list all tags and categorize posts accordingly.

Here's what I have so far. (It's not working.)

create ["/tags.html"] $ do
route idRoute
compile $ do
tags <- buildTags "posts/*" (fromCapture "tags.html#*")
let tagsCtx =
listField "tags" postCtx (return tags) `mappend`
constField "title" "Tags" `mappend`
defaultContext
makeItem ""
= applyTemplate postListTemplate tagsCtx
= applyTemplate defaultTemplate defaultContext
= relativizeUrls
= cleanIndexUrls
Thanks in advance for any help you'd be able to provide!

-Jonathan
--
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.
Jasper Van der Jeugt
2018-03-10 17:40:10 UTC
Permalink
Hi Jonathan,

I do something fairly similar on this page, but with years, not tags:

http://burningwheelstour.ch/events/archive/

The code to that can be found here:

https://github.com/jaspervdj/burningwheelstour.ch

Hope this helps,
Jasper
Post by j***@gmail.com
The tutorial here
<https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html>
has instructions for how to add tag pages to a Hakyll blog, i.e.,
`tags/tag1.html`, `tags/tag2.html`, etc. But is there a way to have a
single page with a list of tags, and a list of posts with each tag? I'm
basically trying to recreate this page <http://jonreeve.com/tags/> from my
Jekyll website where I list all tags and categorize posts accordingly.
Here's what I have so far. (It's not working.)
create ["/tags.html"] $ do
route idRoute
compile $ do
tags <- buildTags "posts/*" (fromCapture "tags.html#*")
let tagsCtx =
listField "tags" postCtx (return tags) `mappend`
constField "title" "Tags" `mappend`
defaultContext
makeItem ""
= applyTemplate postListTemplate tagsCtx
= applyTemplate defaultTemplate defaultContext
= relativizeUrls
= cleanIndexUrls
Thanks in advance for any help you'd be able to provide!
-Jonathan
--
You received this message because you are subscribed to the Google Groups "hakyll" group.
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.
j***@gmail.com
2018-03-22 13:57:12 UTC
Permalink
Hi Jasper,

I've been struggling to understand that code, but I'm just not that good of
a Haskell programmer yet. Could you or someone else provide an example
function for creating a page that displays all tags? I've been staring at
the Hakyll Tags.hs for hours now, and I don't think I understand it well
enough to make something that would work.

I think it would be really useful to others, too, to know how to do this.
Post by Jasper Van der Jeugt
Hi Jonathan,
http://burningwheelstour.ch/events/archive/
https://github.com/jaspervdj/burningwheelstour.ch
Hope this helps,
Jasper
Post by j***@gmail.com
The tutorial here
<
https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html
<https://www.google.com/url?q=https%3A%2F%2Fjavran.github.io%2Fposts%2F2014-03-01-add-tags-to-your-hakyll-blog.html&sa=D&sntz=1&usg=AFQjCNHzZe_tFRnUe9iGLkk8MtF85IcGHQ>>
Post by j***@gmail.com
has instructions for how to add tag pages to a Hakyll blog, i.e.,
`tags/tag1.html`, `tags/tag2.html`, etc. But is there a way to have a
single page with a list of tags, and a list of posts with each tag? I'm
basically trying to recreate this page <http://jonreeve.com/tags/> from
my
Post by j***@gmail.com
Jekyll website where I list all tags and categorize posts accordingly.
Here's what I have so far. (It's not working.)
create ["/tags.html"] $ do
route idRoute
compile $ do
tags <- buildTags "posts/*" (fromCapture "tags.html#*")
let tagsCtx =
listField "tags" postCtx (return tags) `mappend`
constField "title" "Tags" `mappend`
defaultContext
makeItem ""
= applyTemplate postListTemplate tagsCtx
= applyTemplate defaultTemplate defaultContext
= relativizeUrls
= cleanIndexUrls
Thanks in advance for any help you'd be able to provide!
-Jonathan
--
You received this message because you are subscribed to the Google
Groups "hakyll" group.
Post by j***@gmail.com
To unsubscribe from this group and stop receiving emails from it, send
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.
j***@gmail.com
2018-10-14 17:28:30 UTC
Permalink
So, I'm still struggling with creating a single tags page. I have a little
more experience with Haskell now, but apparently not enough to understand
all the monadic contexts, and how tags work in Hakyll. I just posted on
Stack Overflow about it
here: https://stackoverflow.com/questions/52805193/in-hakyll-how-can-i-generate-a-tags-page
and posted the little code I've tried so far. If someone could chime in
there with some direction, at least, it'd be super helpful for me (and all
others that want single tag pages). Thanks in advance!
Post by j***@gmail.com
Hi Jasper,
I've been struggling to understand that code, but I'm just not that good
of a Haskell programmer yet. Could you or someone else provide an example
function for creating a page that displays all tags? I've been staring at
the Hakyll Tags.hs for hours now, and I don't think I understand it well
enough to make something that would work.
I think it would be really useful to others, too, to know how to do this.
Post by Jasper Van der Jeugt
Hi Jonathan,
http://burningwheelstour.ch/events/archive/
https://github.com/jaspervdj/burningwheelstour.ch
Hope this helps,
Jasper
Post by j***@gmail.com
The tutorial here
<
https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html
<https://www.google.com/url?q=https%3A%2F%2Fjavran.github.io%2Fposts%2F2014-03-01-add-tags-to-your-hakyll-blog.html&sa=D&sntz=1&usg=AFQjCNHzZe_tFRnUe9iGLkk8MtF85IcGHQ>>
Post by j***@gmail.com
has instructions for how to add tag pages to a Hakyll blog, i.e.,
`tags/tag1.html`, `tags/tag2.html`, etc. But is there a way to have a
single page with a list of tags, and a list of posts with each tag? I'm
basically trying to recreate this page <http://jonreeve.com/tags/>
from my
Post by j***@gmail.com
Jekyll website where I list all tags and categorize posts accordingly.
Here's what I have so far. (It's not working.)
create ["/tags.html"] $ do
route idRoute
compile $ do
tags <- buildTags "posts/*" (fromCapture "tags.html#*")
let tagsCtx =
listField "tags" postCtx (return tags) `mappend`
constField "title" "Tags" `mappend`
defaultContext
makeItem ""
= applyTemplate postListTemplate tagsCtx
= applyTemplate defaultTemplate defaultContext
= relativizeUrls
= cleanIndexUrls
Thanks in advance for any help you'd be able to provide!
-Jonathan
--
You received this message because you are subscribed to the Google
Groups "hakyll" group.
Post by j***@gmail.com
To unsubscribe from this group and stop receiving emails from it, send
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.
j***@gmail.com
2018-10-27 21:52:05 UTC
Permalink
I'm still struggling with creating a single tags index. What would really
be great is if someone who knows how Hakyll works would just write a
function in the Tags module for rendering a list of all tags with their
associated pages. That way I could have a template like this
pseudo-template:
$for(tags)$
$tag$
$for(post in tag)$
- $url$ - $title$
$endfor$
$endfor$

What does everyone think?
Post by j***@gmail.com
So, I'm still struggling with creating a single tags page. I have a little
more experience with Haskell now, but apparently not enough to understand
all the monadic contexts, and how tags work in Hakyll. I just posted on
https://stackoverflow.com/questions/52805193/in-hakyll-how-can-i-generate-a-tags-page
and posted the little code I've tried so far. If someone could chime in
there with some direction, at least, it'd be super helpful for me (and all
others that want single tag pages). Thanks in advance!
Post by j***@gmail.com
Hi Jasper,
I've been struggling to understand that code, but I'm just not that good
of a Haskell programmer yet. Could you or someone else provide an example
function for creating a page that displays all tags? I've been staring at
the Hakyll Tags.hs for hours now, and I don't think I understand it well
enough to make something that would work.
I think it would be really useful to others, too, to know how to do this.
Post by Jasper Van der Jeugt
Hi Jonathan,
http://burningwheelstour.ch/events/archive/
https://github.com/jaspervdj/burningwheelstour.ch
Hope this helps,
Jasper
Post by j***@gmail.com
The tutorial here
<
https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html
<https://www.google.com/url?q=https%3A%2F%2Fjavran.github.io%2Fposts%2F2014-03-01-add-tags-to-your-hakyll-blog.html&sa=D&sntz=1&usg=AFQjCNHzZe_tFRnUe9iGLkk8MtF85IcGHQ>>
Post by j***@gmail.com
has instructions for how to add tag pages to a Hakyll blog, i.e.,
`tags/tag1.html`, `tags/tag2.html`, etc. But is there a way to have a
single page with a list of tags, and a list of posts with each tag?
I'm
Post by j***@gmail.com
basically trying to recreate this page <http://jonreeve.com/tags/>
from my
Post by j***@gmail.com
Jekyll website where I list all tags and categorize posts accordingly.
Here's what I have so far. (It's not working.)
create ["/tags.html"] $ do
route idRoute
compile $ do
tags <- buildTags "posts/*" (fromCapture "tags.html#*")
let tagsCtx =
listField "tags" postCtx (return tags) `mappend`
constField "title" "Tags" `mappend`
defaultContext
makeItem ""
= applyTemplate postListTemplate tagsCtx
= applyTemplate defaultTemplate defaultContext
= relativizeUrls
= cleanIndexUrls
Thanks in advance for any help you'd be able to provide!
-Jonathan
--
You received this message because you are subscribed to the Google
Groups "hakyll" group.
Post by j***@gmail.com
To unsubscribe from this group and stop receiving emails from it, send
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...