diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs index e5f92b9..c781cd4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -6,6 +6,7 @@ import Data.Ord (comparing) import Hakyll import Hakyll.Core.Item (Item(itemIdentifier)) +import System.Process (readProcess) main :: IO () main = hakyllWith configuration $ do @@ -13,9 +14,18 @@ main = hakyllWith configuration $ do route idRoute compile copyFileCompiler - match "design/*.hs" $ do - route $ setExtension "css" - compile $ getResourceString >>= withItemBody (unixFilter "runghc" []) + match "design/*" $ do + route $ customRoute $ const "main.css" + compile $ do + filePath <- getResourceFilePath + unsafeCompiler (readProcess "runghc" [ filePath ] "") + >>= makeItem + + match "js/*" $ do + route $ customRoute $ const "main.js" + compile $ + unsafeCompiler (readProcess "pulp" [ "build", "--optimise", "--src-path", "js" ] "") + >>= makeItem match "recipes/*" $ do route $ setExtension "html" |