Initial Commit
This commit is contained in:
commit
d545e3b85f
15 changed files with 148 additions and 0 deletions
35
site.hs
Normal file
35
site.hs
Normal file
|
@ -0,0 +1,35 @@
|
|||
--------------------------------------------------------------------------------
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
import Hakyll
|
||||
import Text.Pandoc.Options
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
hakyllConfig :: Configuration
|
||||
hakyllConfig =
|
||||
defaultConfiguration
|
||||
{ deployCommand =
|
||||
"rsync -ave \"ssh\" _site/ ohqo@192.168.50.1:/var/www/htdocs/electriclam.com --delete"
|
||||
}
|
||||
|
||||
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
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue