simiweb/Main.hs

34 lines
758 B
Haskell
Raw Permalink Normal View History

2024-01-31 16:20:02 +01:00
{-# LANGUAGE OverloadedStrings #-}
import qualified GHC.IO.Encoding as E
import Data.Monoid (mappend)
import Hakyll
main :: IO ()
main = do
E.setLocaleEncoding E.utf8
hakyll $ do
match "assets/css/*" $ do
route idRoute
compile compressCssCompiler
match "assets/images/*" $ do
route idRoute
compile copyFileCompiler
2024-02-04 17:06:16 +01:00
match "index.md" $ do
2024-01-31 16:20:02 +01:00
route $ setExtension "html"
compile $ pandocCompiler
2024-02-04 17:06:16 +01:00
>>= loadAndApplyTemplate "index.html" defaultContext
>>= relativizeUrls
match "index.html" $ compile templateBodyCompiler
2024-01-31 16:20:02 +01:00
2024-02-04 17:06:16 +01:00
{-match "index.html" $ do
2024-01-31 16:20:02 +01:00
route $ idRoute
compile $ getResourceBody
2024-02-04 17:06:16 +01:00
>>= relativizeUrls-}
2024-01-31 16:20:02 +01:00
match "layouts/*" $ compile templateBodyCompiler