feat: add git commit hash into footer

This commit is contained in:
rramiachraf 2024-03-05 19:47:02 +01:00
parent 9b0f8fb96a
commit 23b11d2edf
4 changed files with 46 additions and 18 deletions

View File

@ -1,4 +1,6 @@
VERSION=`git rev-parse --short HEAD`
gentempl: gentempl:
@command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest @command -v templ &> /dev/null || go install github.com/a-h/templ/cmd/templ@latest
build:gentempl build:gentempl
templ generate && go build -o dumb templ generate && go build -ldflags="-X 'github.com/rramiachraf/dumb/data.Version=$(VERSION)' -s -w"

3
data/data.go Normal file
View File

@ -0,0 +1,3 @@
package data
var Version = "DEVELOPMENT"

View File

@ -225,24 +225,22 @@ a {
color: #333; color: #333;
} }
@media screen and (max-width: 900px) { footer {
#container { background-color: #ffcd38;
padding: 3rem 2rem; padding: 1rem 0;
display: flex;
flex-direction: column;
gap: 3rem;
width: calc(100vw - 4rem);;
}
#metadata {
align-items: center;
}
} }
footer { #footer_container {
text-align: center; width: 1024px;
background-color: #ffcd38; display: flex;
padding: 1rem; justify-content: space-between;
align-items: center;
margin: 0 auto;
}
#version {
font-size: 1.3rem;
color: #1b1b1b;
} }
footer a { footer a {
@ -349,6 +347,26 @@ footer a:hover {
border-radius: 5px; 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 */ /* dark mode */
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body { body {

View File

@ -1,7 +1,12 @@
package views package views
import "github.com/rramiachraf/dumb/data"
templ footer() { templ footer() {
<footer> <footer>
<div id="footer_container">
<a rel="noopener noreferrer" target="_blank" href="https://github.com/rramiachraf/dumb">Source Code</a> <a rel="noopener noreferrer" target="_blank" href="https://github.com/rramiachraf/dumb">Source Code</a>
<p id="version">{ data.Version }</p>
</div>
</footer> </footer>
} }