info-page/site.hs

39 lines
1.2 KiB
Haskell
Raw Normal View History

2025-01-05 17:24:58 -05:00
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
import Hakyll
import Text.Pandoc.Options
--------------------------------------------------------------------------------
hakyllConfig :: Configuration
hakyllConfig =
defaultConfiguration
{ deployCommand =
2025-01-05 19:13:43 -05:00
"rsync -ave ssh --rsync-path=/usr/bin/openrsync _site/ ohqo@192.168.50.1:/var/www/htdocs/electriclam.com --delete"
2025-01-05 17:24:58 -05:00
}
pandocOptions :: WriterOptions
pandocOptions = defaultHakyllWriterOptions {writerHTMLMathMethod = MathML }
main :: IO ()
main =
hakyllWith hakyllConfig $ do
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "papers/*" $ do
route idRoute
compile copyFileCompiler
2025-01-05 19:13:43 -05:00
match "images/favicon.ico" $ do
route (constRoute "favicon.ico")
compile copyFileCompiler
2025-01-05 17:24:58 -05:00
match "index.org" $ do
route $ setExtension "html"
compile $ do
let indexCtx = constField "title" "Yiyun Liu" <> defaultContext
pandocCompiler
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls
match "templates/*" $ compile templateBodyCompiler