Small tutorial how to include external code snippets in your Hakyll blog

86 views
Skip to first unread message

tobi....@googlemail.com

unread,
Apr 27, 2019, 3:24:36 PM4/27/19
to hakyll
Hi everyone

Recently I switched my static site generator from Pelican to Hakyll.

With Pelican I used a plugin to include external code snippets in my blog posts, that were also properly syntax highlighted.
I really liked the functionality and also wanted to stay backwards compatible to my already existing files.

I wrote a small blog post describing two possible solutions to achieve this in Hakyll. My favored solution is to use fenced divs offered by Pandoc's markdown.

I hope this can be of some help to others with similar needs.

Best regards
Tobias


Ashton Charbonneau

unread,
Nov 1, 2019, 10:59:08 AM11/1/19
to hakyll
Thanks Tobias! I wanted to do something similar, and came across pandoc-include-code. If you don't dislike the semantics, it's easy to add to a codebase and it allows including only specific lines, arbitrary paths, and de-indenting.

Ashton
Reply all
Reply to author
Forward
0 new messages