|
|
|
@ -31,18 +31,10 @@ main = hakyllWith config $ do |
|
|
|
|
route idRoute |
|
|
|
|
compile compressCssCompiler |
|
|
|
|
|
|
|
|
|
match ("posts/*" .||. "publications/*") $ do |
|
|
|
|
route $ setExtension "html" |
|
|
|
|
compile $ |
|
|
|
|
pandocCompiler |
|
|
|
|
>>= loadAndApplyTemplate "templates/post.html" postCtx |
|
|
|
|
>>= loadAndApplyTemplate "templates/default.html" postCtx |
|
|
|
|
>>= relativizeUrls |
|
|
|
|
|
|
|
|
|
match "index.html" $ do |
|
|
|
|
route idRoute |
|
|
|
|
compile $ do |
|
|
|
|
posts <- loadAll "posts/*" |
|
|
|
|
posts <- recentFirst =<< loadAll "posts/*" |
|
|
|
|
pubs <- recentFirst =<< loadAll "publications/*" |
|
|
|
|
|
|
|
|
|
let indexCtx = listField "publications" postCtx (return pubs) <> listField "posts" postCtx (return posts) `mappend` defaultContext |
|
|
|
@ -52,6 +44,13 @@ main = hakyllWith config $ do |
|
|
|
|
>>= loadAndApplyTemplate "templates/default.html" indexCtx |
|
|
|
|
>>= relativizeUrls |
|
|
|
|
|
|
|
|
|
match ("posts/*" .||. "publications/*") $ do |
|
|
|
|
route $ setExtension "html" |
|
|
|
|
compile $ |
|
|
|
|
pandocCompiler |
|
|
|
|
>>= loadAndApplyTemplate "templates/post.html" postCtx |
|
|
|
|
>>= relativizeUrls |
|
|
|
|
|
|
|
|
|
match "gallery.html" $ do |
|
|
|
|
route idRoute |
|
|
|
|
compile $ do |
|
|
|
@ -73,4 +72,4 @@ main = hakyllWith config $ do |
|
|
|
|
|
|
|
|
|
-------------------------------------------------------------------------------- |
|
|
|
|
postCtx :: Context String |
|
|
|
|
postCtx = modificationTimeField "modded" "%B %e, %Y" `mappend` defaultContext |
|
|
|
|
postCtx = mconcat [modificationTimeField "modded" "%B %e, %Y", dateField "parsed-date" "%B %e, %Y", defaultContext] |
|
|
|
|