Post listing?

This commit is contained in:
2023-03-29 22:49:20 +03:00
parent 23658182c2
commit c1058994f3
4 changed files with 301 additions and 10 deletions

View File

@ -36,6 +36,7 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/post.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
@ -43,6 +44,7 @@ main = hakyllWith defaultConfiguration{ignoreFile = ignore} $ do
match "projects/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/project.html" postContext
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
@ -97,7 +99,7 @@ archive Archive{..} = create [output] $ do
listField "items" context items
<> constField "title" title
<> defaultContext
items = recentFirst =<< loadAll input
items = recentFirst =<< loadAllSnapshots input "content"
makeItem ""
>>= loadAndApplyTemplate template itemsContext
>>= loadAndApplyTemplate "templates/default.html" itemsContext