aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2017-05-08 20:44:45 +0200
committerJoris2017-05-08 20:44:45 +0200
commit14433a928f7fdf9be3193812cbbed1a5ae49ecd7 (patch)
treea9a81b57922ba007f9864db9fbe789e559d10fb3 /src
parent9e4c00c3df11b7ffc1e9b626ffbf5a74521b5a7a (diff)
downloadcooking-14433a928f7fdf9be3193812cbbed1a5ae49ecd7.tar.gz
cooking-14433a928f7fdf9be3193812cbbed1a5ae49ecd7.tar.bz2
cooking-14433a928f7fdf9be3193812cbbed1a5ae49ecd7.zip
Let the user upgrade an ingredient quantity and adapt other quantities
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs16
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"