From 0079d42ef128a1d91daa4f483f2b65e3e9b6bfdc Mon Sep 17 00:00:00 2001 From: Joris Date: Thu, 23 Feb 2017 10:21:12 +0100 Subject: Add shortbread recipe --- .tmuxinator.yml | 2 +- Cooking.cabal | 1 + Cooking.hs | 39 --------------------------------------- Makefile | 5 ++++- recipes/shortbread.md | 42 ++++++++++++++++++++++++++++++++++++++++++ shell.nix | 4 ++-- src/Cooking.hs | 43 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 93 insertions(+), 43 deletions(-) delete mode 100644 Cooking.hs create mode 100644 recipes/shortbread.md create mode 100644 src/Cooking.hs diff --git a/.tmuxinator.yml b/.tmuxinator.yml index c3a79fc..f6e037e 100644 --- a/.tmuxinator.yml +++ b/.tmuxinator.yml @@ -5,4 +5,4 @@ windows: layout: fff4,119x58,0,0{94x58,0,0,0,24x58,95,0,1} panes: - # Empty - - make install watch + - make clean install watch diff --git a/Cooking.cabal b/Cooking.cabal index 64cea49..7f5117d 100644 --- a/Cooking.cabal +++ b/Cooking.cabal @@ -5,6 +5,7 @@ cabal-version: >= 1.10 executable Cooking main-is: Cooking.hs + hs-source-dirs: src ghc-options: -threaded default-language: Haskell2010 build-depends: base diff --git a/Cooking.hs b/Cooking.hs deleted file mode 100644 index 809f50f..0000000 --- a/Cooking.hs +++ /dev/null @@ -1,39 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -import Data.Monoid (mappend) -import Hakyll - -main :: IO () -main = hakyllWith configuration $ do - match "images/*" $ do - route idRoute - compile copyFileCompiler - - match "design/*.hs" $ do - route $ setExtension "css" - compile $ getResourceString >>= withItemBody (unixFilter "runghc" []) - - match "recipes/*" $ do - route $ setExtension "html" - compile $ pandocCompiler - >>= loadAndApplyTemplate "templates/main.html" defaultContext - >>= relativizeUrls - - match "index.html" $ do - route idRoute - let context = - listField "recipes" defaultContext (loadAll "recipes/*") `mappend` - defaultContext - compile $ - getResourceBody - >>= applyAsTemplate context - >>= loadAndApplyTemplate "templates/main.html" context - >>= relativizeUrls - - match "templates/*" $ compile templateBodyCompiler - -configuration :: Configuration -configuration = defaultConfiguration - { destinationDirectory = "public" - , inMemoryCache = True - } diff --git a/Makefile b/Makefile index cbe04d2..62f36a6 100644 --- a/Makefile +++ b/Makefile @@ -12,4 +12,7 @@ build: @cabal run build watch: - @cabal run watch + @nodemon --watch src -e hs --exec 'make watch-command --silent' + +watch-command: + @(killall Cooking || :) && sleep 1 && cabal run watch diff --git a/recipes/shortbread.md b/recipes/shortbread.md new file mode 100644 index 0000000..e5bf2d6 --- /dev/null +++ b/recipes/shortbread.md @@ -0,0 +1,42 @@ +--- +title: Shortbread +--- + +Ingrédients +----------- + +- 175 g de farine. +- 175 g de beurre. +- 60 g de cassonade. +- 40 cl de lait concentré sucré. +- 20 cl de lait concentré non sucré. +- 150 g de chocolat noir. +- 1 CS de Maïzena. + +Recette +------- + +### Biscuit + +#. Sortir le beurre pour le ramollir à température ambiante. +#. Préchauffer le four à 190°C. +#. Beurrer les parois d’un moule carré ou recouvrer-le de papier sulfurisé. +#. Mélanger la farine, la cassonade et 125 g de beurre mou en morceaux. +#. Étaler la pâte obtenue dans le moule. +#. Piquer la préparation à la fourchette. +#. Enfourner 10 minutes. + +### Caramel + +#. Mettre 50 g de beurre à fondre dans une casserole. +#. Toujours en cuisson, y ajouter les laits concentrés. et la Maïzena. +#. Remuer jusqu’à l’obtention d’une crème épaisse à la couleur dorée. +#. Verser le caramel crémeux sur le biscuit. +#. Laisser refroidir. + +### Chocolat + +#. Casser le chocolat en morceaux dans une casserole. +#. Le faire fondre à feu doux avec une cuillère à soupe d’eau. +#. Recouvrir le caramel avec le chocolat fondu. +#. Laisser refroidir. diff --git a/shell.nix b/shell.nix index eb2427e..6ede61e 100644 --- a/shell.nix +++ b/shell.nix @@ -2,14 +2,14 @@ with import {}; { env = stdenv.mkDerivation { name = "env"; buildInputs = with pkgs; [ - # ghc cabal-install cabal2nix tmux tmuxinator + nodePackages.nodemon (haskellPackages.ghcWithPackages (p: with p; [ (haskell.lib.dontCheck hakyll) - clay + (haskell.lib.dontCheck clay) text ])) ]; diff --git a/src/Cooking.hs b/src/Cooking.hs new file mode 100644 index 0000000..e5f92b9 --- /dev/null +++ b/src/Cooking.hs @@ -0,0 +1,43 @@ +{-# LANGUAGE OverloadedStrings #-} + +import Data.List (sortBy) +import Data.Monoid (mappend) +import Data.Ord (comparing) + +import Hakyll +import Hakyll.Core.Item (Item(itemIdentifier)) + +main :: IO () +main = hakyllWith configuration $ do + match "images/*" $ do + route idRoute + compile copyFileCompiler + + match "design/*.hs" $ do + route $ setExtension "css" + compile $ getResourceString >>= withItemBody (unixFilter "runghc" []) + + match "recipes/*" $ do + route $ setExtension "html" + compile $ pandocCompiler + >>= loadAndApplyTemplate "templates/main.html" defaultContext + >>= relativizeUrls + + match "index.html" $ do + route idRoute + let context = + listField "recipes" defaultContext (loadAll "recipes/*") `mappend` + defaultContext + compile $ + getResourceBody + >>= applyAsTemplate context + >>= loadAndApplyTemplate "templates/main.html" context + >>= relativizeUrls + + match "templates/*" $ compile templateBodyCompiler + +configuration :: Configuration +configuration = defaultConfiguration + { destinationDirectory = "public" + , inMemoryCache = True + } -- cgit v1.2.3