Small refactor

This commit is contained in:
Chris Hodapp 2019-10-27 23:13:46 -04:00
parent 4d0f72fd4f
commit b4ea1f4a03

14
site.hs
View File

@ -143,18 +143,18 @@ main = do
-- works/* for the above to actually work? -- works/* for the above to actually work?
match "templates/*" $ compile templateCompiler 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 create ["atom.xml"] $ do
route idRoute route idRoute
compile $ do compileFeed renderAtom
posts <- recentFirst =<< loadAllSnapshots ("posts/*" .&&. complement "posts/*.lhs") "feedContent"
renderAtom feedConfiguration feedCtx posts
create ["rss.xml"] $ do create ["rss.xml"] $ do
route idRoute route idRoute
compile $ do compileFeed renderRss
posts <- recentFirst =<< loadAllSnapshots ("posts/*" .&&. complement "posts/*.lhs") "feedContent"
renderRss feedConfiguration feedCtx posts
tagsRules tags $ \tag pattern -> do tagsRules tags $ \tag pattern -> do
let title = "Posts tagged \"" ++ tag ++ "\"" let title = "Posts tagged \"" ++ tag ++ "\""