module Web.Page.Lucid
( module Web.Page.Types
, template ) where
import Web.Page.Types
import Lucid
import Lucid.Base
import qualified Data.Text as T
import Data.Monoid
template :: Monad m =>
WebPage (HtmlT m ()) T.Text
-> HtmlT m ()
-> HtmlT m ()
template page content = doctypehtml_ $ mconcat $
[ head_ [] $ mconcat $
[ initScripts page
, title_ $ toHtmlRaw $ pageTitle page
, metaVars page
, link_ [ rel_ "icon"
, href_ $ favicon page
]
, beforeStylesScripts page
, styles page
, afterStylesScripts page
]
, body_ [] $ mconcat $
[ content
, bodyScripts page
]
]