@@ -13,15 +13,25 @@ the CSS. This would be an example of such a file:
13``` haskell
13``` haskell
14{-# LANGUAGE OverloadedStrings #-}
14{-# LANGUAGE OverloadedStrings #-}
15import Clay
15import Clay
16−import qualified Data.Text.Lazy.IO as T
18test :: Css
17test :: Css
21main :: IO ()
20main :: IO ()
22−main = T.putStr $ render test
21+main = putCss test
24+If you prefer the compact version, you're going to have an extra import:
28+import qualified Data.Text.Lazy.IO as T
31+main = T.putStr $ renderWith compact test
25Let's assume such a file is called `css/foo.hs`. In our compiled site, we want
35Let's assume such a file is called `css/foo.hs`. In our compiled site, we want
26to map this to `css/foo.css`. Hence, the route is a simple `setExtension`. For
36to map this to `css/foo.css`. Hence, the route is a simple `setExtension`. For
27compilation, we simply pass the Clay file through `runghc` with no options.
37compilation, 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.
30match "css/*.hs" $ do
40match "css/*.hs" $ do
31 route $ setExtension "css"
41 route $ setExtension "css"
32 compile $ getResourceString >>= withItemBody (unixFilter "runghc" [])
42 compile $ getResourceString >>= withItemBody (unixFilter "runghc" [])
44+-- cabal sandbox users can use (unixFilter "cabal" ["exec", "runghc"])
45+-- given that you've added cabal to your PATH
35The major advantage of using this method (as opposed to importing the Clay files
48The major advantage of using this method (as opposed to importing the Clay files