diff options
author | "Vincent Ambo ext:(%22) <tazjin@me.com> | 2012-02-22T21·03+0100 |
---|---|---|
committer | "Vincent Ambo ext:(%22) <tazjin@me.com> | 2012-02-22T21·03+0100 |
commit | b951faa6b4771693f08b4002c771a508904d97a1 (patch) | |
tree | 93177791ac00c21ea864920db9ed6faefee4bea3 /src/Blog.hs |
* initial checkin
Diffstat (limited to 'src/Blog.hs')
-rw-r--r-- | src/Blog.hs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Blog.hs b/src/Blog.hs new file mode 100644 index 000000000000..2a62bb768072 --- /dev/null +++ b/src/Blog.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE OverloadedStrings, ScopedTypeVariables #-} +module Blog where + +import Text.Blaze (toValue, preEscapedString) +import Text.Blaze.Html5 (Html, (!), a, form, input, p, toHtml, label) +import Text.Blaze.Html5.Attributes (action, enctype, href, name, size, type_, value) +import qualified Text.Blaze.Html5 as H +import qualified Text.Blaze.Html5.Attributes as A + +blogTemplate :: String -> String -> String -> Html +blogTemplate t h o = H.docTypeHtml $ do + H.head $ do + H.title $ (toHtml t) + H.link ! A.rel "alternate" ! A.type_ "application/rss+xml" ! A.title "RSS-Feed" ! A.href "/rss" + H.link ! A.rel "stylesheet" ! A.type_ "text/css" ! A.href "/res/blogstyle.css" ! A.media "all" + H.meta ! A.httpEquiv "content-type" ! A.content "text/html;charset=UTF-8" +{- H.style ! A.type_ "text/css" ! A.title "iOS iMessage" ! A.media "screen and (max-device-width: 1024px)" $ "#cosx{display:none;} #cios{display:block;}" -} + H.body $ do + H.div ! A.class_ "mainshell" $ H.div ! A.class_ "gradBox" $ H.div ! A.class_ "header" $ do + H.a ! A.href "/" ! A.style "text-decoration:none;color:black;font-size:x-large;font-weight:bold;" $ + (toHtml t) + H.br + H.span ! A.id "cosx" ! A.style "display:block;" $ H.b $ contactInfo "imessage:tazjin@me.com" + H.span ! A.id "cios" ! A.style "display:none;" $ H.b $ contactInfo "sms:tazjin@me.com" + where + contactInfo (imu :: String) = do + toHtml h + H.a ! A.href "mailto:hej@tazj.in" $ "Mail" + ", " + H.a ! A.href "http://twitter.com/#!/tazjin" ! A.target "_blank" $ "Twitter" + toHtml o + H.a ! A.href (toValue imu) ! A.target "_blank" $ "iMessage" + "." \ No newline at end of file |