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"
28 post <- pandocCompiler
29 saveSnapshot "content" post
31 >>= loadAndApplyTemplate "templates/post.html" postCtx
32 >>= loadAndApplyTemplate "templates/default.html" postCtx
35 match "archive.html" $ do
39 field "posts" (\_ -> postList recentFirst) `mappend`
40 constField "title" "Archives" `mappend`
44 >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
45 >>= loadAndApplyTemplate "templates/default.html" archiveCtx
49 match "index.html" $ do
52 let indexCtx = field "posts" $ \_ -> postList (take 3 . recentFirst)
55 >>= applyAsTemplate indexCtx
56 >>= loadAndApplyTemplate "templates/default.html" postCtx
59 match "templates/*" $ compile templateCompiler
62--------------------------------------------------------------------------------
63postCtx :: Context String
65 dateField "date" "%B %e, %Y" `mappend`
69--------------------------------------------------------------------------------
70postList :: ([Item String] -> [Item String]) -> Compiler String
71postList preprocess = do
72 posts <- preprocess <$> loadAll "posts/*"
73 itemTpl <- loadBody "templates/post-item.html"
74 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