Disable ormolu for hakyll DSL-y code; only bring in a stylesheet if we have one

This commit is contained in:
Robert Pearce 2020-11-02 12:28:23 -05:00
parent 9244c2e20f
commit 8cec937b86
No known key found for this signature in database
GPG key ID: 07A0E482E5616C9B
9 changed files with 70 additions and 56 deletions

View file

@ -40,6 +40,8 @@ config =
-- BUILD
{- ORMOLU_DISABLE -}
main :: IO ()
main = hakyllWith config $ do
forM_
@ -57,6 +59,7 @@ main = hakyllWith config $ do
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "posts/*" $ do
let ctx = constField "type" "article" <> postCtx
route $ metadataRoute titleRoute
@ -65,6 +68,7 @@ main = hakyllWith config $ do
>>= loadAndApplyTemplate "templates/post.html" ctx
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/default.html" ctx
match "index.html" $ do
route idRoute
compile $ do
@ -77,7 +81,10 @@ main = hakyllWith config $ do
getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
match "templates/*" $ compile templateBodyCompiler
match "templates/*" $
compile templateBodyCompiler
create ["sitemap.xml"] $ do
route idRoute
compile $ do
@ -89,13 +96,17 @@ main = hakyllWith config $ do
<> listField "pages" postCtx (return pages)
makeItem ("" :: String)
>>= loadAndApplyTemplate "templates/sitemap.xml" sitemapCtx
create ["rss.xml"] $ do
route idRoute
compile (feedCompiler renderRss)
create ["atom.xml"] $ do
route idRoute
compile (feedCompiler renderAtom)
{- ORMOLU_ENABLE -}
-- CONTEXT
feedCtx :: Context String