{-# LANGUAGE OverloadedStrings #-}
module Main where

import Control.Arrow ((>>>))
import Control.Monad (forM_)

import Hakyll

main :: IO ()
main = hakyll $ do
    -- Read templates
    compile "templates/*" templateCompiler
    
    -- Compress CSS
    route   "css/*" idRoute
    compile "css/*" compressCssCompiler
    
    -- Archive downloads
    route   "downloads/*" idRoute
    compile "downloads/*" copyFileCompiler
    
    -- Documentation pages
    forM_ [ "index.md"
          , "license.md"
          ] $ \page -> do
        route   page $ setExtension ".html"
        compile page $ pageCompiler
            >>> applyTemplateCompiler "templates/default.html"
            >>> relativizeUrlsCompiler

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Control.Arrow ((>>>))
import Control.Monad (forM_)

import Hakyll

main :: IO ()
main = hakyll $ do
    -- Read templates
    match "templates/*" $ compile templateCompiler
    
    -- Compress CSS
    match "css/*" $ do
        route   idRoute
        compile compressCssCompiler
    
    -- Archive downloads
    match "downloads/*" $ do
        route   idRoute
        compile copyFileCompiler
    
    -- Documentation pages
    forM_ [ "index.md"
          , "license.md"
          ] $ \page -> do
        match page $ do
            route   $ setExtension ".html"
            compile $ pageCompiler
                >>> applyTemplateCompiler "templates/default.html"
                >>> relativizeUrlsCompiler

Update site for new routing style in Hakyll 3.1.
Update site for new routing style in Hakyll 3.1.
