diff options
Diffstat (limited to 'web/tutorials')
-rw-r--r-- | web/tutorials/01-installation.markdown | 2 | ||||
-rw-r--r-- | web/tutorials/faq.markdown | 3 | ||||
-rw-r--r-- | web/tutorials/using-clay-with-hakyll.markdown | 17 |
3 files changed, 19 insertions, 3 deletions
diff --git a/web/tutorials/01-installation.markdown b/web/tutorials/01-installation.markdown index c02a86e..5421c73 100644 --- a/web/tutorials/01-installation.markdown +++ b/web/tutorials/01-installation.markdown @@ -49,7 +49,7 @@ The file `site.hs` holds the configuration of your site, as an executable haskell program. We can compile and run it like this: $ cd my-site - $ ghc --make site.hs + $ ghc --make -threaded site.hs $ ./site build If you installed `hakyll` with a preview server (this is the default), you can diff --git a/web/tutorials/faq.markdown b/web/tutorials/faq.markdown index 66dd4e6..87c1a92 100644 --- a/web/tutorials/faq.markdown +++ b/web/tutorials/faq.markdown @@ -24,6 +24,9 @@ using something like: You should also add this to your `.profile`, or whatever config file you use. +On Windows, running `chcp 65001` before running your Hakyll executable has been +reported to work. + ## "File name does not match module name" on Mac OS Hakyll.hs:1:1: diff --git a/web/tutorials/using-clay-with-hakyll.markdown b/web/tutorials/using-clay-with-hakyll.markdown index e557c3d..c676a80 100644 --- a/web/tutorials/using-clay-with-hakyll.markdown +++ b/web/tutorials/using-clay-with-hakyll.markdown @@ -13,15 +13,25 @@ the CSS. This would be an example of such a file: ``` haskell {-# LANGUAGE OverloadedStrings #-} import Clay -import qualified Data.Text.Lazy.IO as T test :: Css test = ... main :: IO () -main = T.putStr $ render test +main = putCss test ``` +If you prefer the compact version, you're going to have an extra import: + + +``` haskell +import qualified Data.Text.Lazy.IO as T + +main :: IO () +main = T.putStr $ renderWith compact test +``` + + Let's assume such a file is called `css/foo.hs`. In our compiled site, we want to map this to `css/foo.css`. Hence, the route is a simple `setExtension`. For compilation, we simply pass the Clay file through `runghc` with no options. @@ -30,6 +40,9 @@ compilation, we simply pass the Clay file through `runghc` with no options. match "css/*.hs" $ do route $ setExtension "css" compile $ getResourceString >>= withItemBody (unixFilter "runghc" []) + +-- cabal sandbox users can use (unixFilter "cabal" ["exec", "runghc"]) +-- given that you've added cabal to your PATH ``` The major advantage of using this method (as opposed to importing the Clay files |