From b4ea1f4a036bce5983d71648c3429226bd8c60a2 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Sun, 27 Oct 2019 23:13:46 -0400 Subject: [PATCH] Small refactor --- site.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/site.hs b/site.hs index d15e7b3..581e4b0 100644 --- a/site.hs +++ b/site.hs @@ -143,18 +143,18 @@ main = do -- works/* for the above to actually work? match "templates/*" $ compile templateCompiler - + + let compileFeed f = compile $ do + posts <- recentFirst =<< loadAllSnapshots ("posts/*" .&&. complement "posts/*.lhs") "feedContent" + f feedConfiguration feedCtx posts + create ["atom.xml"] $ do route idRoute - compile $ do - posts <- recentFirst =<< loadAllSnapshots ("posts/*" .&&. complement "posts/*.lhs") "feedContent" - renderAtom feedConfiguration feedCtx posts + compileFeed renderAtom create ["rss.xml"] $ do route idRoute - compile $ do - posts <- recentFirst =<< loadAllSnapshots ("posts/*" .&&. complement "posts/*.lhs") "feedContent" - renderRss feedConfiguration feedCtx posts + compileFeed renderRss tagsRules tags $ \tag pattern -> do let title = "Posts tagged \"" ++ tag ++ "\""