tags

31 views
Skip to first unread message

allan.l...@gmail.com

unread,
Oct 7, 2017, 9:41:22 PM10/7/17
to hakyll
i'm struggling to add support for tags to my site.

i followed the external tutorial linked to from the main page (https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html) but it's not working as expected.

after fighting for a while trying to integrate it with my existing site source, i figured it best to just hakyll-init a new site, follow the instructions, compare with the provided final source code, etc., but i just can't get it to work.

following the steps in the tutorial allows it to gather the tags from the posts' metadata correctly, print them into the header content of the post, but, crucially, it doesn't create any /tag[s]/x.html page (or link to such page) for each tag 'x' -- though the tutorial claims such functionality.

i don't see any mention of hyperlinks in the tutorial, so i could understand why 'tags: x, y' doesn't create a couple of hyperlinks, but the real issue is that the basic /tags/x.html pages aren't being generated as the tutorial claims should be.

i do notice the guide is from 2014 with hakyll v4.4.3.2, though i should imagine the advice should still work with v4.9.8.0.

any advice? is anyone aware of a more recent treatment of this issue? while i'm haskell-competent in a functional programming sense, i'm nowhere near experienced enough with hakyll to handle this myself.

cheers,
allan.

Jean-Marc Notin

unread,
Oct 9, 2017, 9:12:44 AM10/9/17
to hak...@googlegroups.com
Hi,

I followed the tutorial you mentioned starting with a fresh hakyll
project (generated using stack and its hakyll-template, which uses
hakyll-4.9.8.0). Everything seems to work as advertised: I get a file
tag/x.html generated for every tag x.
Those files are generated by the call to tagRules; the pattern for the
generated files is given by (fromCapture "tags/*.html") in the call to
buildTags.

Regards,
> --
> 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+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Jean-Marc Notin

allan.l...@gmail.com

unread,
Oct 10, 2017, 4:42:47 PM10/10/17
to hakyll
Thanks for your reply - it made me keep fighting with it.

I downloaded the zip file from the tutorial, and used `stack exec site build`, which didn't build any tags files. `ghc site.hs; ./site rebuild` worked perfectly. I suspect there's something wrong with my stack installation, though I haven't come across any problems with it before.

Cheers,
Allan.

Jan Tojnar

unread,
Oct 11, 2017, 4:26:36 AM10/11/17
to hak...@googlegroups.com
Hello.

Did you also run stack build? Even when site executable was build by stack, it cannot rebuild itself – stack exec site build will only build the site content.

Jan

To unsubscribe from this group and stop receiving emails from it, send an email to hakyll+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages