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"
23 defaultTpl <- loadBody "templates/default.html"
25 >>= applyTemplate defaultTpl defaultContext
28 compile $ pageCompiler
29 >>= loadAndApplyTemplate "templates/default.html" defaultContext
34 route $ setExtension "html"
37 saveSnapshot "content" post
39 >>= loadAndApplyTemplate "templates/post.html" postCtx
40 >>= loadAndApplyTemplate "templates/default.html" postCtx
43 match "archive.html" $ do
47 field "posts" (\_ -> postList recentFirst) `mappend`
48 constField "title" "Archives" `mappend`
52 >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
53 >>= loadAndApplyTemplate "templates/default.html" archiveCtx
57 match "index.html" $ do
60 let indexCtx = field "posts" $ \_ -> postList (take 3 . recentFirst)
63 >>= applyAsTemplate indexCtx
64 >>= loadAndApplyTemplate "templates/default.html" postCtx
67 match "templates/*" $ compile templateCompiler
70--------------------------------------------------------------------------------
71postCtx :: Context String
73 dateField "date" "%B %e, %Y" `mappend`
77--------------------------------------------------------------------------------
78postList :: ([Item String] -> [Item String]) -> Compiler String
79postList preprocess = do
80 posts <- preprocess <$> loadAll "posts/*"
81 itemTpl <- loadBody "templates/post-item.html"
82 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