website/site.hs

49 lines
1.4 KiB
Haskell
Raw Normal View History

2014-02-01 17:11:40 +01:00
-----------------------------------------------------------
{-# LANGUAGE Arrows #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
-----------------------------------------------------------
import Control.Applicative ((<$>))
import Data.Monoid (mappend, mconcat)
import Prelude hiding (id)
import System.FilePath (replaceExtension, takeDirectory)
import qualified Text.Pandoc as Pandoc
-----------------------------------------------------------
import Hakyll
-----------------------------------------------------------
-- | Entry point
main :: IO ()
main = hakyllWith config $ do
match "favicon.png" $ do
route idRoute
compile copyFileCompiler
match "images/*" $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "templates/*" $ compile $ templateCompiler
match "*.md" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/default.html" defaultContext
>>= relativizeUrls
--------------------------------------------------------------------------------
config :: Configuration
config = defaultConfiguration
{ deployCommand = "rsync --checksum -ave 'ssh -p 4242' \
\_site/* fab@ffreling.com:public_html/ffreling.com/public/"
}