aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2020-02-02 13:53:54 +0100
committerJoris2020-02-02 13:58:19 +0100
commit0ce8744897b9aa13ea568a6985da9570e4aca90b (patch)
tree3619508ff9ec5d846c567c3562d05ca77e686c76 /src
parent13d29804ba4bb8d578fb0278ddeb6e187bbafa6f (diff)
downloadcooking-0ce8744897b9aa13ea568a6985da9570e4aca90b.tar.gz
cooking-0ce8744897b9aa13ea568a6985da9570e4aca90b.tar.bz2
cooking-0ce8744897b9aa13ea568a6985da9570e4aca90b.zip
Use zola generator
- Use CSS instead of Haskell with Clay - Use TypeScript instead of PureScript
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/Main.hs b/src/Main.hs
deleted file mode 100644
index 50a562d..0000000
--- a/src/Main.hs
+++ /dev/null
@@ -1,57 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-import Data.List (sortBy)
-import Data.Monoid (mappend)
-import Data.Ord (comparing)
-import Hakyll
-import Hakyll.Core.Item (Item (itemIdentifier))
-import System.Process (readProcess)
-import qualified System.Process as Process (rawSystem)
-
-main :: IO ()
-main = hakyllWith configuration $ do
- match "images/*" $ do
- route idRoute
- compile copyFileCompiler
-
- match "design/**" $ do
- route $ customRoute $ const "main.css"
- compile $ do
- filePath <- getResourceFilePath
- unsafeCompiler (readProcess "runghc" [ filePath ] "")
- >>= makeItem
-
- match "js/src/**" $ do
- route $ customRoute $ const "main.js"
- compile $
- unsafeCompiler (readProcess "pulp" [ "--psc-package", "build", "--optimise", "--src-path", "js" ] "")
- >>= makeItem
-
- match "recettes/**" $ do
- route $ setExtension "html"
- compile $ pandocCompiler
- >>= loadAndApplyTemplate "templates/recipe.html" defaultContext
- >>= relativizeUrls
-
- match "index.html" $ do
- route idRoute
- let context =
- listField "mainDishes" defaultContext (loadAll "recettes/plats/*") `mappend`
- listField "lowCarbDesserts" defaultContext (loadAll "recettes/desserts/hypoglucidique/*") `mappend`
- listField "highCarbDesserts" defaultContext (loadAll "recettes/desserts/hyperglucidique/*") `mappend`
- listField "cleaningRecipes" defaultContext (loadAll "recettes/nettoyage/*") `mappend`
- defaultContext
- compile $
- getResourceBody
- >>= applyAsTemplate context
- >>= loadAndApplyTemplate "templates/index.html" context
- >>= relativizeUrls
-
- match "templates/*" $ compile templateBodyCompiler
-
-configuration :: Configuration
-configuration = defaultConfiguration
- { destinationDirectory = "public"
- , deploySite = const $
- Process.rawSystem "rsync" [ "-avzh", "public/", "joris@guyonvarch.me:/var/www/cooking.guyonvarch.me" ]
- }