diff --git a/src/Main.hs b/src/Main.hs index 46873b7..cceec0d 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -110,6 +110,20 @@ main = do defaultCtx full >>= relativizeUrls + create ["atom.xml"] $ do + route idRoute + compile $ do + loadAllSnapshots "site/posts/*.md" "content" + >>= recentFirst + >>= renderAtom feedConf feedCtx + + create ["rss.xml"] $ do + route idRoute + compile $ do + loadAllSnapshots "site/posts/*.md" "content" + >>= recentFirst + >>= renderRss feedConf feedCtx + -------------------------------------------------------------------------------- myRoute :: Routes @@ -135,6 +149,25 @@ config = defaultConfiguration -------------------------------------------------------------------------------- +feedCtx :: Context String +feedCtx = mconcat + [ bodyField "description" + , defaultContext + ] + +-------------------------------------------------------------------------------- + +feedConf :: FeedConfiguration +feedConf = FeedConfiguration + { feedTitle = "Chaosone news" + , feedDescription = "News from eastern european hackerspaces" + , feedAuthorName = "Chaoszone members" + , feedAuthorEmail = "nek0@chaoszone.cz" + , feedRoot = "https://chaoszone.cz" + } + +-------------------------------------------------------------------------------- + sortIdentifiersByDate :: [Identifier] -> [Identifier] sortIdentifiersByDate = sortBy byDate