need to have functionality to read posts for rss and the like use the url made idk

This commit is contained in:
Pagwin 2024-10-25 23:33:12 -04:00
parent bfc43ed5e8
commit 3c68c4f344
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -49,6 +49,9 @@ buildSite = do
postPaths <- Shake.getDirectoryFiles "" postGlobs
Shake.need $ map indexHtmlOutputPath postPaths
-- posts list
Shake.need [indexHtmlOutputPath "posts"]
-- remaining pages, index.xml = rss feed
Shake.need $ map (outputDir </>) ["index.html", "index.xml"]
@ -58,6 +61,7 @@ buildRules = do
assets
pages
postsRule
postList
rss
-- make a rule of the pattern outputDir/asset_name which copes from outputDir/../pages
@ -140,6 +144,13 @@ home =
applyTemplateAndWrite "default.html" page target
Shake.putInfo $ "Built " <> target
postList :: Rules ()
postList =
outputDir </> "posts/index.html" %> \target -> do
postPaths <- Shake.getDirectoryFiles "" postGlobs
posts <- sortOn (Ord.Down . postDate) <$> forM postPaths readPost
applyTemplateAndWrite "posts.html" (HM.singleton "posts" posts) target
rss :: Rules ()
rss =
outputDir </> "index.xml" %> \target -> do