From 14433a928f7fdf9be3193812cbbed1a5ae49ecd7 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 8 May 2017 20:44:45 +0200 Subject: Let the user upgrade an ingredient quantity and adapt other quantities --- src/Main.hs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/Main.hs') 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" -- cgit v1.2.3