Created
March 21, 2012 13:54
-
-
Save usagi/2147061 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/runhaskell | |
\begin{code} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Arrow ((>>>)) | |
import Control.Arrow ((>>^)) | |
import Hakyll | |
import Text.CSS.CleverCSS | |
import System.IO.Unsafe | |
main = hakyll $ do | |
match "favicon.ico" $ do | |
route idRoute | |
compile copyFileCompiler | |
match "images/" $ do | |
route idRoute | |
compile copyFileCompiler | |
match "css/*.css" $ do | |
route idRoute | |
compile compressCssCompiler | |
match "css/*.clevercss" $ do | |
route $ setExtension "css" | |
compile $ getResourceString | |
>>^ cleverCSSFilter | |
>>^ compressCss | |
match "templates/*" $ compile templateCompiler | |
match "*.markdown" $ do | |
route $ setExtension "html" | |
compile $ pageCompiler | |
>>> applyTemplateCompiler "templates/default.html" | |
>>> relativizeUrlsCompiler | |
cleverCSSFilter :: String -> String | |
cleverCSSFilter i = | |
case (unsafePerformIO $ cleverCSSConvert [] i []) of | |
Right r -> r | |
\end{code} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment