Assuming you've already created your index.markdown
file to replace index.html
you can change site.hs
to look like:
getResourceBody
>>= applyAsTemplate indexCtx
>>= return . renderPandoc
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
The new line is the 3rd one, >>= return . renderPandoc
.
The Pandoc compiler will render your HTML-based templates fine, however you may need to remove indentation from the HTML-based templates so Pandoc doesn't confuse the templates as code blocks.
I've used and tested this solution, but all credit for identifying the solutions is due to Jasper's answer in the Hakyll forums: https://groups.google.com/forum/#!topic/hakyll/ooMEwuiQZ24