{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module Blog where import BlogStore import Data.Text (Text, pack) import qualified Data.Text as T import Data.Text.Lazy (fromStrict) import Data.Time import Text.Blaze.Html (preEscapedToHtml) import Text.Hamlet import Text.Markdown blogTitle :: Text = "tazjin's blog" repoURL :: Text = "https://bitbucket.org/tazjin/tazblog-haskell" mailTo :: Text = "mailto:mail@tazj.in" twitter :: Text = "https://twitter.com/tazjin" replace :: Eq a => a -> a -> [a] -> [a] replace x y = map (\z -> if z == x then y else z) -- |After this date all entries are Markdown markdownCutoff :: Day markdownCutoff = fromGregorian 2013 04 28 blogTemplate :: Text -> Html -> Html blogTemplate t_append body = [shamlet| $doctype 5