From c363ea999b3e276840296599fe8eb4dc83aeb217 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 4 Feb 2019 12:33:29 -0800 Subject: Upgrade design - correctly using .card-body, .card-title, .card-subtitle - add more spacing overall - add jumbotron callout/info banner - add separate css file for custom css --- ibb/Main.hs | 63 ++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 15 deletions(-) (limited to 'ibb/Main.hs') diff --git a/ibb/Main.hs b/ibb/Main.hs index 2c5bb1b..8607278 100644 --- a/ibb/Main.hs +++ b/ibb/Main.hs @@ -3,19 +3,26 @@ module Main where -import Data.Text (Text) +import Data.ByteString.Lazy (ByteString) +import Data.Text.Lazy (Text) +import Data.Text.Lazy.Encoding (encodeUtf8) import Text.Blaze (Markup) import Text.Blaze.Html (Html) import Text.Blaze.Html.Renderer.Text (renderHtml) import Text.Hamlet (shamlet) -import Web.Scotty (ActionM, scotty, get, html) +import Text.Lucius (lucius, renderCss) +import Web.Scotty (ActionM, scotty, get, html, raw, setHeader) render :: Html -> ActionM () render = html . renderHtml +css :: ByteString -> ActionM () +css src = setHeader "content-type" "text/css" >> raw src + main :: IO () -main = scotty 3000 $ +main = scotty 3000 $ do get "/" $ render homepage + get "/custom.css" $ css stylesheet data Person = Person { _name :: Text @@ -98,26 +105,52 @@ allPeople = displayPerson :: Person -> Markup displayPerson person = [shamlet| -
+
-

#{_name person} -