{-# LANGUAGE OverloadedStrings #-} module Main where import Network.Wai.Middleware.RequestLogger (logStdoutDev) import Text.Blaze.Html.Renderer.Text (renderHtml) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A import qualified Web.Scotty as S buildPage :: H.Html -> H.Html -> H.Html buildPage header content = do H.docTypeHtml $ do H.head $ do H.meta H.! A.charset "utf-8" H.title "Black Tape | Progressive Indie Rock from Paris" H.link H.! A.rel "stylesheet" H.! A.href "css/style.css" H.body $ do header content buildHeader :: H.Html buildHeader = do H.header $ do H.nav H.! A.class_ "stickynav" $ do H.ul $ do -- Black Tape main link H.li H.! A.class_ "header-logo" $ do H.a H.! A.class_ "#" $ H.toHtml "Black Tape" -- Central links links -- Social links socialLinks where links = do H.li $ H.toHtml "alo" socialLinks = do H.li H.! A.class_ "header-icons" $ do mapM_ (\(icon, link) -> H.a H.! A.href link $ H.i H.! A.class_ icon $ H.toHtml "") [("fa fa-facebook", "#")] main :: IO () main = S.scotty 3000 $ do S.middleware logStdoutDev S.get "/" $ do S.html . renderHtml $ do buildPage buildHeader $ H.h1 "Hello"