|
|
@@ -67,32 +67,37 @@ main = do |
|
|
|
>>= relativizeUrls |
|
|
|
>>= cleanIndexUrls |
|
|
|
|
|
|
|
-- Compile posts + save snapshots for the web feeds |
|
|
|
match "posts/*" $ do |
|
|
|
route $ cleanRoute |
|
|
|
-- Compile and load posts |
|
|
|
match "index.md" $ do |
|
|
|
route $ setExtension "html" |
|
|
|
compile $ pandocCompiler |
|
|
|
>>= loadAndApplyTemplate "templates/post.html" postCtx |
|
|
|
>>= saveSnapshot "content" |
|
|
|
>>= loadAndApplyTemplate "templates/default.html" postCtx |
|
|
|
>>= loadAndApplyTemplate "templates/index.html" ctx |
|
|
|
>>= relativizeUrls |
|
|
|
>>= cleanIndexUrls |
|
|
|
>>= cleanIndexHtmls |
|
|
|
|
|
|
|
-- Compile and load posts |
|
|
|
match "index.html" $ do |
|
|
|
route idRoute |
|
|
|
compile $ do |
|
|
|
posts <- (return . (take 5)) |
|
|
|
=<< recentFirst |
|
|
|
=<< loadAll "posts/*" |
|
|
|
let indexCtx = |
|
|
|
listField "posts" postCtx (return posts) <> ctx |
|
|
|
getResourceBody |
|
|
|
pandocCompiler |
|
|
|
>>= applyAsTemplate indexCtx |
|
|
|
>>= loadAndApplyTemplate "templates/index.html" indexCtx |
|
|
|
>>= loadAndApplyTemplate "templates/default.html" indexCtx |
|
|
|
>>= relativizeUrls |
|
|
|
>>= cleanIndexUrls |
|
|
|
>>= cleanIndexHtmls |
|
|
|
|
|
|
|
-- Compile posts + save snapshots for the web feeds |
|
|
|
match "posts/*" $ do |
|
|
|
route $ cleanRoute |
|
|
|
compile $ pandocCompiler |
|
|
|
>>= loadAndApplyTemplate "templates/post.html" postCtx |
|
|
|
>>= saveSnapshot "content" |
|
|
|
>>= loadAndApplyTemplate "templates/default.html" postCtx |
|
|
|
>>= relativizeUrls |
|
|
|
>>= cleanIndexUrls |
|
|
|
>>= cleanIndexHtmls |
|
|
|
|
|
|
|
-- Agnememnon the Fuck-Upperer - Conquerer of Small Type Declarations |
|
|
|
compileFeed :: |
|
|
|