From 1b320c5b479b7420f142788a7a6f7b88e54aaf3b Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 7 Jun 2023 00:00:43 +0200 Subject: [PATCH] template work --- assets/static/lcsb.svg | 148 +++++++++++++++++++++++++++++++++ assets/static/r3.svg | 1 + assets/static/unilu.svg | 8 ++ assets/style.css | 176 ++++++++++++++++++++++++++++++++++++++++ site.hs | 12 +-- templates/default.html | 2 + templates/footer.html | 12 +++ templates/head.html | 4 + templates/header.html | 18 ++++ templates/tag.html | 2 + 10 files changed, 377 insertions(+), 6 deletions(-) create mode 100644 assets/static/lcsb.svg create mode 100644 assets/static/r3.svg create mode 100644 assets/static/unilu.svg create mode 100644 templates/footer.html create mode 100644 templates/header.html diff --git a/assets/static/lcsb.svg b/assets/static/lcsb.svg new file mode 100644 index 0000000..88ad5a5 --- /dev/null +++ b/assets/static/lcsb.svg @@ -0,0 +1,148 @@ + +image/svg+xml diff --git a/assets/static/r3.svg b/assets/static/r3.svg new file mode 100644 index 0000000..552f9c5 --- /dev/null +++ b/assets/static/r3.svg @@ -0,0 +1 @@ +r3-logo \ No newline at end of file diff --git a/assets/static/unilu.svg b/assets/static/unilu.svg new file mode 100644 index 0000000..1e63bb5 --- /dev/null +++ b/assets/static/unilu.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/style.css b/assets/style.css index e69de29..55262b9 100644 --- a/assets/style.css +++ b/assets/style.css @@ -0,0 +1,176 @@ +html { + font-family: 'Roboto', sans-serif; + font-size: 12pt; + line-height: 1.5; + color: #000; +} + +a { + text-decoration: none; + color: #0ad; +} + +a:hover { + text-decoration: underline; +} + +body { + margin: 0px; + background: white; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Roboto Condensed', sans-serif; + color: #444; + /* this might need rethinking but looks good for navigation + border-left: 1rem solid; + border-color: #aaa; + margin-left: -2rem; + padding-left: 1rem; + */ +} + +h1 { + font-size: 250%; + font-weight: bold; +} + +h2 { + font-size: 200%; + font-weight: bold; +} + +h3 { + font-size: 150%; + font-weight: 300; +} + +h4 { + font-size: 120%; + font-weight: bold; +} + +h5 { + font-size: 100%; + font-weight: bold; +} + +h6 { + font-size: 100%; + font-weight: 300; +} + +.layout-topbar { + height: 8rem; + background: linear-gradient(to bottom, #fafafa, #fafafa 66%, #eeeeee); + display: flex; +} + +.topbar-borderbottom { + border-bottom: 1pt solid #777; +} + +.bar-fill { + flex-grow: 1; +} + +.same-height { + height: inherit; + display: flex; +} + +.topbar-lcsb { + align-self: flex-end; + padding-bottom: 1rem; +} + +.logo-lcsb { + height: 5rem; + width: 5rem; + background-image: url('static/lcsb.svg'); + background-size: contain; + background-repeat: no-repeat; +} + +.topbar-text { + align-self: flex-end; + padding: 2rem; + padding-bottom: 1rem; + font-family: 'Roboto Condensed', sans-serif; + font-weight: 300; + line-height: 1.2; + color: #777; +} + +.header-title { + font-size: 250%; +} + +.header-subtitle { + font-size: 150%; +} + +.topbar-unilu { + background: white; + align-self: flex-end; + padding: 1.5rem; + padding-bottom: 0.2rem; + border: solid 1pt #777; + border-bottom: none; + border-radius: 20px 20px 0 0; +} + +.logo-unilu { + height: 5rem; + width: 6rem; + background-image: url('static/unilu.svg'); + background-size: contain; + background-repeat: no-repeat; +} + + +.width-content { + width: 980px; +} + +.footer-box { + height: 10rem; + background-color: #aaa; + box-shadow: + inset 10rem -10rem 10rem 0px #fff, + inset -10rem -10rem 10rem 0px #fff; + display: flex; +} + +.footer-r3 { + align-self: center; + height: 2rem; + width: 2rem; + background-image: url('static/r3.svg'); + background-size: contain; + background-repeat: no-repeat; +} + +.footer-lcsb { + align-self: center; + margin-left: 1rem; + height: 2rem; + width: 2rem; + background-image: url('static/lcsb.svg'); + background-size: contain; + background-repeat: no-repeat; +} + +.footer-text { + align-self: center; + margin-left: 2rem; + max-width: 75%; + + font: 'Roboto Condensed', sans-serif; + font-size: 80%; + color: #777; +} + +.margin-center { + margin: 0 auto; +} diff --git a/site.hs b/site.hs index 1a88da7..dafe23f 100644 --- a/site.hs +++ b/site.hs @@ -66,7 +66,8 @@ loadPage fp = do T.unpack . just ("mount point of " ++ fp) $ yml ^? key "mount" . _String existing <- use $ pages . to (M.!? mount) case existing of - Just pi -> error $ "mount for " ++ fp ++ " already exists from " ++ _pagePath pi + Just pi -> + error $ "mount for " ++ fp ++ " already exists from " ++ _pagePath pi _ -> pure () {- save to the state -} pages %= @@ -262,11 +263,10 @@ tagLink = rootUrl . ("tag" ) . tagPath -- | Make metadata for printing out a single hierarchical tag (all levels clickable) makeHTagMeta :: [String] -> Site Y.Value makeHTagMeta tag = do - links <- zip (Y.Null:map fromString tag) . map fromString <$> traverse tagLink (inits tag) - pure . Y.array $ - map - (\(t, p) -> Y.object [("tag", t), ("href", p)]) - links + links <- + zip (Y.Null : map fromString tag) . map fromString <$> + traverse tagLink (inits tag) + pure . Y.array $ map (\(t, p) -> Y.object [("tag", t), ("href", p)]) links -- | Make metadata for printing out a single tag as-is, without levels makeHTagLinkMeta :: [String] -> Site Y.Value diff --git a/templates/default.html b/templates/default.html index 214229e..2bb48e5 100644 --- a/templates/default.html +++ b/templates/default.html @@ -1,6 +1,8 @@ {{> head.html}} +{{> header.html}} {{{body}}} +{{> footer.html}} diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..d8c36b0 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,12 @@ +