website/site.hs
Fabien Freling 68e09d3f5d Remove project duplicates.
Project pages were actually in the root directory (and outdated).
The ‘projects’ directory was not used by hakyll (but containing
up-to-date pages).

- Update hakyll rules to compile project pages.
- Remove oudated project pages.
2014-02-23 16:29:37 +01:00

46 lines
1.4 KiB
Haskell

-----------------------------------------------------------
{-# 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 ("images/*" .||. "favicon.png") $ do
route idRoute
compile copyFileCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler
match "templates/*" $ compile $ templateCompiler
match ("*.md" .||. "projects/*/*.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/"
}