aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2017-05-10 08:48:19 +0200
committerJoris2017-05-10 08:48:19 +0200
commit851b14df862eaeed3a8d783630f5e45ef22c5c7f (patch)
tree16913d3e90c774ecca810e48d2ee78927d30eabf
parentb15bf20e39b38783ffd521eb7caf4c471d54ef0d (diff)
Group by main dishes / desserts (high / low carbs)
-rw-r--r--README.md1
-rw-r--r--recipes/desserts/high-carb/brownie-aux-noix.md (renamed from recipes/brownie-aux-noix.md)0
-rw-r--r--recipes/desserts/high-carb/cookies.md (renamed from recipes/cookies.md)0
-rw-r--r--recipes/desserts/high-carb/crème-aux-œufs.md (renamed from recipes/crème-aux-œufs.md)0
-rw-r--r--recipes/desserts/high-carb/crème-chocolat.md (renamed from recipes/crème-chocolat.md)0
-rw-r--r--recipes/desserts/high-carb/crêpes.md (renamed from recipes/crêpes.md)0
-rw-r--r--recipes/desserts/high-carb/financiers.md (renamed from recipes/financiers.md)0
-rw-r--r--recipes/desserts/high-carb/fondant-chocolat.md (renamed from recipes/fondant-chocolat.md)0
-rw-r--r--recipes/desserts/high-carb/shortbread.md (renamed from recipes/shortbread.md)0
-rw-r--r--recipes/desserts/low-carb/fudge.md (renamed from recipes/fudge.md)0
-rw-r--r--recipes/main-dishes/riz-vinaigre-casserole.md (renamed from recipes/riz-vinaigre-casserole.md)0
-rw-r--r--recipes/main-dishes/riz-vinaigre-vita-vapeur.md (renamed from recipes/riz-vinaigre-vita-vapeur.md)0
-rw-r--r--src/Main.hs6
-rw-r--r--templates/recipe-list.html24
14 files changed, 27 insertions, 4 deletions
diff --git a/README.md b/README.md
index 9a124c4..44d7c1f 100644
--- a/README.md
+++ b/README.md
@@ -28,4 +28,3 @@ TODO
----
- add tests for purescript parser
-- group by (Plat / Dessert (High / Low carb))
diff --git a/recipes/brownie-aux-noix.md b/recipes/desserts/high-carb/brownie-aux-noix.md
index 8b6d881..8b6d881 100644
--- a/recipes/brownie-aux-noix.md
+++ b/recipes/desserts/high-carb/brownie-aux-noix.md
diff --git a/recipes/cookies.md b/recipes/desserts/high-carb/cookies.md
index 76545be..76545be 100644
--- a/recipes/cookies.md
+++ b/recipes/desserts/high-carb/cookies.md
diff --git a/recipes/crème-aux-œufs.md b/recipes/desserts/high-carb/crème-aux-œufs.md
index e9890bf..e9890bf 100644
--- a/recipes/crème-aux-œufs.md
+++ b/recipes/desserts/high-carb/crème-aux-œufs.md
diff --git a/recipes/crème-chocolat.md b/recipes/desserts/high-carb/crème-chocolat.md
index 06b042c..06b042c 100644
--- a/recipes/crème-chocolat.md
+++ b/recipes/desserts/high-carb/crème-chocolat.md
diff --git a/recipes/crêpes.md b/recipes/desserts/high-carb/crêpes.md
index b549528..b549528 100644
--- a/recipes/crêpes.md
+++ b/recipes/desserts/high-carb/crêpes.md
diff --git a/recipes/financiers.md b/recipes/desserts/high-carb/financiers.md
index cdced3a..cdced3a 100644
--- a/recipes/financiers.md
+++ b/recipes/desserts/high-carb/financiers.md
diff --git a/recipes/fondant-chocolat.md b/recipes/desserts/high-carb/fondant-chocolat.md
index 3be8ec5..3be8ec5 100644
--- a/recipes/fondant-chocolat.md
+++ b/recipes/desserts/high-carb/fondant-chocolat.md
diff --git a/recipes/shortbread.md b/recipes/desserts/high-carb/shortbread.md
index 65e74af..65e74af 100644
--- a/recipes/shortbread.md
+++ b/recipes/desserts/high-carb/shortbread.md
diff --git a/recipes/fudge.md b/recipes/desserts/low-carb/fudge.md
index 7aa4517..7aa4517 100644
--- a/recipes/fudge.md
+++ b/recipes/desserts/low-carb/fudge.md
diff --git a/recipes/riz-vinaigre-casserole.md b/recipes/main-dishes/riz-vinaigre-casserole.md
index fb6c332..fb6c332 100644
--- a/recipes/riz-vinaigre-casserole.md
+++ b/recipes/main-dishes/riz-vinaigre-casserole.md
diff --git a/recipes/riz-vinaigre-vita-vapeur.md b/recipes/main-dishes/riz-vinaigre-vita-vapeur.md
index 32f4ea3..32f4ea3 100644
--- a/recipes/riz-vinaigre-vita-vapeur.md
+++ b/recipes/main-dishes/riz-vinaigre-vita-vapeur.md
diff --git a/src/Main.hs b/src/Main.hs
index c781cd4..dd37fe4 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -27,7 +27,7 @@ main = hakyllWith configuration $ do
unsafeCompiler (readProcess "pulp" [ "build", "--optimise", "--src-path", "js" ] "")
>>= makeItem
- match "recipes/*" $ do
+ match "recipes/**" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/main.html" defaultContext
@@ -36,7 +36,9 @@ main = hakyllWith configuration $ do
match "index.html" $ do
route idRoute
let context =
- listField "recipes" defaultContext (loadAll "recipes/*") `mappend`
+ listField "mainDishes" defaultContext (loadAll "recipes/main-dishes/*") `mappend`
+ listField "lowCarbDesserts" defaultContext (loadAll "recipes/desserts/low-carb/*") `mappend`
+ listField "highCarbDesserts" defaultContext (loadAll "recipes/desserts/high-carb/*") `mappend`
defaultContext
compile $
getResourceBody
diff --git a/templates/recipe-list.html b/templates/recipe-list.html
index 372a2e8..83d0849 100644
--- a/templates/recipe-list.html
+++ b/templates/recipe-list.html
@@ -1,5 +1,27 @@
+<h3>Plats</h3>
+
<ul>
- $for(recipes)$
+ $for(mainDishes)$
+ <li>
+ <a href="$url$">$title$</a>
+ </li>
+ $endfor$
+</ul>
+
+<h3>Desserts hypoglucidiques</h3>
+
+<ul>
+ $for(lowCarbDesserts)$
+ <li>
+ <a href="$url$">$title$</a>
+ </li>
+ $endfor$
+</ul>
+
+<h3>Desserts hyperglucidiques</h3>
+
+<ul>
+ $for(highCarbDesserts)$
<li>
<a href="$url$">$title$</a>
</li>