-Eric Rasmussen
Maybe not those 90's
But static sites are coming back in style
match ("about.markdown" .||. "commands.markdown") $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= applyBase
>>= relativizeUrls
"What's hard to ignore about all these platforms is that, your dad will never blog like this."
-Mike Bayer (author of SQLAlchemy)
configuration via code
match ("images/*" .||. "js/**") $ do
route idRoute
compile copyFileCompiler
match ("css/*" .||. "css/icons/*" .||. "foundation/*") $ do
route $ setExtension "css"
compile sassCompiler
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= saveSnapshot "content"
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/base.html" baseCtx
>>= relativizeUrls
create ["atom.xml"] $ do
route idRoute
compile $ do
loadAllSnapshots "posts/*" "content"
>>= fmap (take 10) . recentFirst
>>= renderAtom (feedConfiguration "All posts") feedCtx
defaultPostCtx :: Tags -> Context String
defaultPostCtx tags = mconcat
[ dateField "date" "%B %e, %Y"
, tagsField "tags" tags
, defaultContext
]
sassCompiler :: Compiler (Item String)
sassCompiler =
getResourceString
>>= withItemBody (unixFilter "sass" ["-s", "--scss"])
>>= return . fmap compressCss
"a monad is a monoid in the category of endofunctors, what's the problem?"
The Hakyll tutorials are a great starting point
But if you already have a favorite language, try:
(ruby devs like DSLs)
(but you can find examples in most languages)
The good news: typically no proprietary format or DB, but...
Use grid layouts to design big
Design small at the same time