1--------------------------------------------------------------------------------
2{-# LANGUAGE OverloadedStrings #-}
3import Data.Monoid (mappend)
7--------------------------------------------------------------------------------
12 compile copyFileCompiler
16 compile compressCssCompiler
18 match (fromList ["about.rst", "contact.markdown"]) $ do
19 route $ setExtension "html"
20 compile $ pandocCompiler
21 >>= loadAndApplyTemplate "templates/default.html" defaultContext
25 route $ setExtension "html"
26 compile $ pandocCompiler
27 >>= loadAndApplyTemplate "templates/post.html" postCtx
28 >>= loadAndApplyTemplate "templates/default.html" postCtx
31 create ["archive.html"] $ do
35 field "posts" (\_ -> postList recentFirst) `mappend`
36 constField "title" "Archives" `mappend`
40 >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
41 >>= loadAndApplyTemplate "templates/default.html" archiveCtx
45 match "index.html" $ do
48 let indexCtx = field "posts" $ \_ ->
49 postList $ fmap (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] -> Compiler [Item String]) -> Compiler String
68postList sortFilter = do
69 posts <- sortFilter =<< 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