site.hs: Fix do block indentation
Strangely this did not fail locally but failed in build. Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
eb156a9531
commit
046d146e51
146
site.hs
146
site.hs
|
@ -8,90 +8,90 @@ main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
E.setLocaleEncoding E.utf8
|
E.setLocaleEncoding E.utf8
|
||||||
hakyllWith config $ do
|
hakyllWith config $ do
|
||||||
match "images/*" $ do
|
match "images/*" $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile copyFileCompiler
|
compile copyFileCompiler
|
||||||
|
|
||||||
match "css/*" $ compile compressCssCompiler
|
match "css/*" $ compile compressCssCompiler
|
||||||
create ["style.css"] $ do
|
create ["style.css"] $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile $ do
|
compile $ do
|
||||||
csses <- loadAll "css/*.css"
|
csses <- loadAll "css/*.css"
|
||||||
makeItem $ unlines $ map itemBody csses
|
makeItem $ unlines $ map itemBody csses
|
||||||
|
|
||||||
match (fromList ["about.markdown"]) $ do
|
match (fromList ["about.markdown"]) $ do
|
||||||
route $ setExtension "html"
|
route $ setExtension "html"
|
||||||
compile $ pandocCompiler
|
compile $ pandocCompiler
|
||||||
>>= loadAndApplyTemplate "templates/default.html" defaultContext
|
>>= loadAndApplyTemplate "templates/default.html" defaultContext
|
||||||
>>= relativizeUrls
|
|
||||||
|
|
||||||
tags <- buildTags "posts/*" (fromCapture "tags/*.html")
|
|
||||||
|
|
||||||
match "posts/*" $ do
|
|
||||||
route $ setExtension "html"
|
|
||||||
compile $ pandocCompiler
|
|
||||||
>>= loadAndApplyTemplate "templates/post.html" (postCtxWithTags tags)
|
|
||||||
>>= loadAndApplyTemplate "templates/default.html" (postCtxWithTags tags)
|
|
||||||
>>= relativizeUrls
|
|
||||||
|
|
||||||
create ["archive.html"] $ do
|
|
||||||
route idRoute
|
|
||||||
compile $ do
|
|
||||||
posts <- recentFirst =<< loadAll "posts/*"
|
|
||||||
let archiveCtx =
|
|
||||||
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
|
||||||
constField "title" "Archives" `mappend`
|
|
||||||
defaultContext
|
|
||||||
|
|
||||||
makeItem ""
|
|
||||||
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
|
|
||||||
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
|
|
||||||
>>= relativizeUrls
|
>>= relativizeUrls
|
||||||
|
|
||||||
match "index.html" $ do
|
tags <- buildTags "posts/*" (fromCapture "tags/*.html")
|
||||||
route idRoute
|
|
||||||
compile $ do
|
|
||||||
posts <- fmap (take 3) . recentFirst =<< loadAll "posts/*"
|
|
||||||
let indexCtx =
|
|
||||||
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
|
||||||
field "tags" (\_ -> renderTagList tags) `mappend`
|
|
||||||
constField "title" "Welcome" `mappend`
|
|
||||||
defaultContext
|
|
||||||
|
|
||||||
getResourceBody
|
match "posts/*" $ do
|
||||||
>>= applyAsTemplate indexCtx
|
route $ setExtension "html"
|
||||||
>>= loadAndApplyTemplate "templates/default.html" indexCtx
|
compile $ pandocCompiler
|
||||||
|
>>= loadAndApplyTemplate "templates/post.html" (postCtxWithTags tags)
|
||||||
|
>>= loadAndApplyTemplate "templates/default.html" (postCtxWithTags tags)
|
||||||
>>= relativizeUrls
|
>>= relativizeUrls
|
||||||
|
|
||||||
create ["sitemap.xml"] $ do
|
create ["archive.html"] $ do
|
||||||
route idRoute
|
route idRoute
|
||||||
compile $ do
|
compile $ do
|
||||||
posts <- recentFirst =<< loadAll "posts/*"
|
posts <- recentFirst =<< loadAll "posts/*"
|
||||||
let sitemapCtx =
|
let archiveCtx =
|
||||||
constField "baseUrl" "sanchayanmaity.gitlab.io" `mappend`
|
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
||||||
constField "title" "Sitemap" `mappend`
|
constField "title" "Archives" `mappend`
|
||||||
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
defaultContext
|
||||||
(postCtxWithTags tags)
|
|
||||||
|
|
||||||
makeItem ""
|
makeItem ""
|
||||||
>>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
|
>>= loadAndApplyTemplate "templates/archive.html" archiveCtx
|
||||||
>>= cleanIndexHtmls
|
>>= loadAndApplyTemplate "templates/default.html" archiveCtx
|
||||||
|
>>= relativizeUrls
|
||||||
|
|
||||||
match "templates/*" $ compile templateBodyCompiler
|
match "index.html" $ do
|
||||||
|
route idRoute
|
||||||
|
compile $ do
|
||||||
|
posts <- fmap (take 3) . recentFirst =<< loadAll "posts/*"
|
||||||
|
let indexCtx =
|
||||||
|
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
||||||
|
field "tags" (\_ -> renderTagList tags) `mappend`
|
||||||
|
constField "title" "Welcome" `mappend`
|
||||||
|
defaultContext
|
||||||
|
|
||||||
tagsRules tags $ \tag pattern -> do
|
getResourceBody
|
||||||
let title = "Posts tagged \"" ++ tag ++ "\""
|
>>= applyAsTemplate indexCtx
|
||||||
route idRoute
|
>>= loadAndApplyTemplate "templates/default.html" indexCtx
|
||||||
compile $ do
|
>>= relativizeUrls
|
||||||
posts <- recentFirst =<< loadAll pattern
|
|
||||||
let ctx = constField "title" title
|
|
||||||
`mappend` listField "posts" (postCtxWithTags tags) (return posts)
|
|
||||||
`mappend` defaultContext
|
|
||||||
|
|
||||||
makeItem ""
|
create ["sitemap.xml"] $ do
|
||||||
>>= loadAndApplyTemplate "templates/tag.html" ctx
|
route idRoute
|
||||||
>>= loadAndApplyTemplate "templates/default.html" ctx
|
compile $ do
|
||||||
>>= relativizeUrls
|
posts <- recentFirst =<< loadAll "posts/*"
|
||||||
|
let sitemapCtx =
|
||||||
|
constField "baseUrl" "sanchayanmaity.gitlab.io" `mappend`
|
||||||
|
constField "title" "Sitemap" `mappend`
|
||||||
|
listField "posts" (postCtxWithTags tags) (return posts) `mappend`
|
||||||
|
(postCtxWithTags tags)
|
||||||
|
|
||||||
|
makeItem ""
|
||||||
|
>>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
|
||||||
|
>>= cleanIndexHtmls
|
||||||
|
|
||||||
|
match "templates/*" $ compile templateBodyCompiler
|
||||||
|
|
||||||
|
tagsRules tags $ \tag pattern -> do
|
||||||
|
let title = "Posts tagged \"" ++ tag ++ "\""
|
||||||
|
route idRoute
|
||||||
|
compile $ do
|
||||||
|
posts <- recentFirst =<< loadAll pattern
|
||||||
|
let ctx = constField "title" title
|
||||||
|
`mappend` listField "posts" (postCtxWithTags tags) (return posts)
|
||||||
|
`mappend` defaultContext
|
||||||
|
|
||||||
|
makeItem ""
|
||||||
|
>>= loadAndApplyTemplate "templates/tag.html" ctx
|
||||||
|
>>= loadAndApplyTemplate "templates/default.html" ctx
|
||||||
|
>>= relativizeUrls
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
config :: Configuration
|
config :: Configuration
|
||||||
|
|
Loading…
Reference in a new issue