- " ++ concat xs ++ "
{-# LANGUAGE OverloadedStrings #-} import Control.Monad (forM) import Data.List (groupBy, sortBy) import Data.Maybe (fromMaybe) import Data.Monoid (mappend) import Data.Time.Clock (UTCTime (..)) import Data.Time.Format (defaultTimeLocale, formatTime) import Data.Tuple (swap) import Hakyll main :: IO () main = hakyllWith defaultConfiguration { providerDirectory = "./public", destinationDirectory = "./site" } $ do match "images/*" $ do route idRoute compile copyFileCompiler match "webfonts/*" $ do route idRoute compile copyFileCompiler match "css/*" $ do route idRoute compile compressCssCompiler match "resume.md" $ do route $ setExtension "html" compile $ pandocCompiler >>= loadAndApplyTemplate "templates/resume-default.html" defaultContext tags <- buildTags "posts/*" (fromCapture "tags/*.html") tagsRules tags $ \t p -> do route idRoute compile $ do posts <- recentFirst =<< loadAll p let tagCtx = constField "title" t `mappend` listField "posts" postCtx (return posts) `mappend` defaultContext makeItem "" >>= loadAndApplyTemplate "templates/tag.html" tagCtx >>= loadAndApplyTemplate "templates/default.html" tagCtx >>= relativizeUrls create ["tags/index.html"] $ do route idRoute compile $ renderTags (\a b c _ _ -> "