Created
September 29, 2024 16:26
-
-
Save joe-warren/31ffdb2d688d6c8df72e6298c5069a6f to your computer and use it in GitHub Desktop.
CompileTagFeeds.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let compileTagFeeds feedType feedExt feedCompiler = | |
tagsRules tags $ \tag pat -> version feedType $ do | |
route (setExtension feedExt) | |
compile $ do | |
(allPosts, ctx) <- loadPattern pat | |
posts <- recentFirst allPosts | |
let feedCtx = ctx `mappend` postCtx | |
tagDescription <- readTagDescriptionFile' | |
let feedConfiguration = myFeedConfiguration | |
{ feedTitle = feedTitle myFeedConfiguration <> " :: Only " <> tag <> " Posts" | |
, feedDescription = tagDescription tag | |
} | |
feedCompiler feedConfiguration feedCtx posts | |
compileTagFeeds "atom" "atom.xml" renderAtom | |
compileTagFeeds "rss" "rss" renderRss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment