1--------------------------------------------------------------------------------
2{-# LANGUAGE OverloadedStrings #-}
3import Control.Applicative ((<$>))
4import Data.Monoid (mappend)
8--------------------------------------------------------------------------------
13 compile copyFileCompiler
17 compile compressCssCompiler
19 match (fromList ["about.rst", "contact.markdown"]) $ do
20 route $ setExtension "html"
21 compile $ pandocCompiler
22 >>= loadAndApplyTemplate "templates/default.html" defaultContext
26 route $ setExtension "html"
27 compile $ pandocCompiler
28 >>= loadAndApplyTemplate "templates/post.html" postCtx
29 >>= loadAndApplyTemplate "templates/default.html" postCtx
32 match "archive.html" $ do
36 field "posts" (\_ -> postList recentFirst) `mappend`
37 constField "title" "Archives" `mappend`
41 >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
42 >>= loadAndApplyTemplate "templates/default.html" archiveCtx
46 match "index.html" $ do
49 let indexCtx = field "posts" $ \_ -> postList (take 3 . recentFirst)
52 >>= applyAsTemplate indexCtx
53 >>= loadAndApplyTemplate "templates/default.html" postCtx
56 match "templates/*" $ compile templateCompiler
59--------------------------------------------------------------------------------
60postCtx :: Context String
62 dateField "date" "%B %e, %Y" `mappend`
66--------------------------------------------------------------------------------
67postList :: ([Item String] -> [Item String]) -> Compiler String
68postList preprocess = do
69 posts <- preprocess <$> loadAll "posts/*"
70 itemTpl <- loadBody "templates/post-item.html"
71 list <- applyTemplateList itemTpl postCtx posts
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list