rework website

This commit is contained in:
2023-11-27 23:49:06 +01:00
parent 782311c832
commit 3f2f910349
6 changed files with 69 additions and 48 deletions

View File

@@ -50,29 +50,29 @@ main = do
defaultCtx
>>= relativizeUrls
create ["index.html"] $ do
route idRoute
compile $ do
post <- fmap head . recentFirst =<< (loadAll "site/posts/*"
:: Compiler [Item String])
let indexCtx =
constField "date" "%B %e, %Y" <>
defaultCtx
makeItem (itemBody post)
>>= relativizeUrls
-- match "site/index.md" $ do
-- route $ myRoute `composeRoutes` setExtension "html"
-- create ["index.html"] $ do
-- route idRoute
-- compile $ do
-- posts <- fmap (take 5) . recentFirst =<< loadAll "site/posts/*"
-- let indexCtx = listField "posts" postCtx (return posts) <>
-- constField "title" "Home" <>
-- post <- fmap head . recentFirst =<< (loadAll "site/posts/*"
-- :: Compiler [Item String])
-- let indexCtx =
-- constField "date" "%B %e, %Y" <>
-- defaultCtx
-- getResourceBody
-- >>= applyAsTemplate indexCtx
-- >>= renderPandoc
-- >>= loadAndApplyTemplate "templates/default.html" defaultCtx
-- >>= relativizeUrls
-- makeItem (itemBody post)
-- >>= relativizeUrls
match "site/index.md" $ do
route $ myRoute `composeRoutes` setExtension "html"
compile $ do
posts <- fmap (take 5) . recentFirst =<< loadAll "site/posts/*"
let indexCtx = listField "posts" postCtx (return posts) <>
constField "title" "Home" <>
defaultCtx
getResourceBody
>>= applyAsTemplate indexCtx
>>= renderPandoc
>>= loadAndApplyTemplate "templates/default.html" defaultCtx
>>= relativizeUrls
create ["archive.html"] $ do
route idRoute