From 23b11d2edfae011cf2fff87477e587aa0f81c994 Mon Sep 17 00:00:00 2001 From: rramiachraf <51409801+rramiachraf@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:47:02 +0100 Subject: [PATCH] feat: add git commit hash into footer --- Makefile | 4 +++- data/data.go | 3 +++ static/style.css | 50 +++++++++++++++++++++++++++++++--------------- views/footer.templ | 7 ++++++- 4 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 data/data.go diff --git a/Makefile b/Makefile index 009f4d6..18c0e46 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ +VERSION=`git rev-parse --short HEAD` + gentempl: @command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest build:gentempl - templ generate && go build -o dumb + templ generate && go build -ldflags="-X 'github.com/rramiachraf/dumb/data.Version=$(VERSION)' -s -w" diff --git a/data/data.go b/data/data.go new file mode 100644 index 0000000..48d6f81 --- /dev/null +++ b/data/data.go @@ -0,0 +1,3 @@ +package data + +var Version = "DEVELOPMENT" diff --git a/static/style.css b/static/style.css index 2691ec4..b583791 100644 --- a/static/style.css +++ b/static/style.css @@ -225,24 +225,22 @@ a { color: #333; } -@media screen and (max-width: 900px) { - #container { - padding: 3rem 2rem; - display: flex; - flex-direction: column; - gap: 3rem; - width: calc(100vw - 4rem);; - } - - #metadata { - align-items: center; - } +footer { + background-color: #ffcd38; + padding: 1rem 0; } -footer { - text-align: center; - background-color: #ffcd38; - padding: 1rem; +#footer_container { + width: 1024px; + display: flex; + justify-content: space-between; + align-items: center; + margin: 0 auto; +} + +#version { + font-size: 1.3rem; + color: #1b1b1b; } footer a { @@ -349,6 +347,26 @@ footer a:hover { border-radius: 5px; } +@media screen and (max-width: 1080px) { + #container { + padding: 3rem 2rem; + display: flex; + flex-direction: column; + gap: 3rem; + width: calc(100vw - 4rem);; + } + + #metadata { + align-items: center; + } + + #footer_container { + width: 100%; + padding: 0 2rem; + box-sizing: border-box; + } +} + /* dark mode */ @media (prefers-color-scheme: dark) { body { diff --git a/views/footer.templ b/views/footer.templ index 1701078..57760e0 100644 --- a/views/footer.templ +++ b/views/footer.templ @@ -1,7 +1,12 @@ package views +import "github.com/rramiachraf/dumb/data" + templ footer() { }