diff options
Diffstat (limited to 'web/tutorials/faq.markdown')
-rw-r--r-- | web/tutorials/faq.markdown | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown index ce90042..6d51617 100644 --- a/web/tutorials/faq.markdown +++ b/web/tutorials/faq.markdown @@ -1,8 +1,47 @@ --- title: FAQ -author: Jasper Van der Jeugt --- +## "File name does not match module name" on Mac OS + + Hakyll.hs:1:1: + File name does not match module name: + Saw: `Main' + Expected: `Hakyll' + +Is an error encountered on Mac OS when `hakyll.hs` is located on a +case-insensitive filesystem. A workaround is to rename it to something that +isn't the name of the module, for example, `site.hs`. + +## `pageCompiler`/Hakyll/Pandoc eats my HTML! + +Sometimes, it can seem that HTML pages are stripped of some arbitrary tags, e.g. +`<div>`'s. The issue here is that, when using the default `pageCompiler`, your +page passes through Pandoc. Pandoc unfortunately strips away this information, +giving you the "wrong" HTML. + +The solution is not to use `pageCompiler` -- it is very common to write custom +page processing compiler. The definition of `pageCompiler` is, put simply: + +~~~~~{.haskell} +pageCompiler = + readPageCompiler >>> + addDefaultFields >>> -- Sets some things like $path$ + arr applySelf >>> -- Used to fill in $var$s in the page + pageRenderPandoc -- Pass through pandoc +~~~~~ + +You can add your own version in your `hakyll.hs` file: + +~~~~~{.haskell} +myPageCompiler = + readPageCompiler >>> + addDefaultFields >>> -- Sets some things like $path$ + arr applySelf >>> -- Used to fill in $var$s in the page +~~~~~ + +And using this instead of `pageCompiler` should solve the issue. + ## Does Hakyll support syntax highlighting? Syntax highlighting is enabled by default in Hakyll. However, you also need to @@ -41,14 +80,3 @@ or [regex-pcre]: http://hackage.haskell.org/package/regex-pcre [pcre]: http://www.pcre.org/ - -## "File name does not match module name" on Mac OS - - Hakyll.hs:1:1: - File name does not match module name: - Saw: `Main' - Expected: `Hakyll' - -Is an error encountered on Mac OS when `hakyll.hs` is located on a -case-insensitive filesystem. A workaround is to rename it to something that -isn't the name of the module, for example, `site.hs`. |