Embedding Discourse into Hakyll
Posted on August 17, 2014
Tags: hakyll
Discourse is a great open sorce forum software. With the recent versions it is now also possible to embedd discourse as comment platform for you blog. It turned out to be fairly simple when using hakyll.
First you should configure hakyll so that an atom feed is created, by following the tutorial at http://jaspervdj.be/hakyll/tutorials/05-snapshots-feeds.html
Then simple add the following template to your posts template at templates/post.html
<div id="discourse-comments"></div>
<script type="text/javascript">
var discourseUrl = "http://forums.geekplace.eu/",
= 'http://geekplace.eu/flow$url$';
discourseEmbedUrl
function() {
(var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
.src = discourseUrl + 'javascripts/embed.js';
ddocument.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
(;
})()</script>
And configure discourse at Site Settings → Embedding
as described in http://eviltrout.com/2014/01/22/embedding-discourse.html