diff options
author | Joris | 2017-05-08 20:44:45 +0200 |
---|---|---|
committer | Joris | 2017-05-08 20:44:45 +0200 |
commit | 14433a928f7fdf9be3193812cbbed1a5ae49ecd7 (patch) | |
tree | a9a81b57922ba007f9864db9fbe789e559d10fb3 /src/Main.hs | |
parent | 9e4c00c3df11b7ffc1e9b626ffbf5a74521b5a7a (diff) |
Let the user upgrade an ingredient quantity and adapt other quantities
Diffstat (limited to 'src/Main.hs')
-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" |