git.mcksp
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
{-# LANGUAGE OverloadedStrings #-}

module Webpage
    ( webpage
    ) where

import Text.Blaze.Html5 as HTML
import Text.Blaze.Html5.Attributes as HTML hiding (title)
import Text.Blaze.Html.Renderer.Utf8 as HTML

webpage :: HTML.Html -> HTML.Html
webpage page = HTML.html $
    HTML.docTypeHtml $ do
        HTML.head $ do
            HTML.title "mckb.co maciek's keyboards"
            HTML.meta ! HTML.charset "utf-8"
            HTML.meta ! name "author" ! content "Maciej SpychaƂa"
            HTML.meta ! name "viewport" ! content "width=device-width, initial-scale=1.0"
            HTML.link ! rel "stylesheet" ! href "/style.css"
        HTML.body $ do
            HTML.div ! HTML.id "page-all" $ do
                navbar
                page

navbar :: HTML.Html
navbar = HTML.div ! HTML.id "navbar" $ do
    HTML.div ! HTML.class_ "left inline" $ do
        HTML.div "logo"
        HTML.div $ HTML.a ! HTML.href "/" $ "mckb.co"
    HTML.div ! HTML.class_ "right inline" $ do
        HTML.div $ HTML.a ! HTML.href "/cart" $ "cart"