diff --git a/.goreleaser.yml b/.goreleaser.yml index 6e0070b..7802053 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -22,7 +22,7 @@ builds: - amd64 - arm64 ldflags: - - -s -w -X {{.ModulePath}}/cmd/version/version.version={{.Version}} + - -s -w -X {{.ModulePath}}/internal/version.Version={{.Version}} -X {{.ModulePath}}/internal/version.GitCommit={{.ShortCommit}} -X {{.ModulePath}}/internal/version.BuildDate={{.Date}} mod_timestamp: "{{ .CommitTimestamp }}" upx: diff --git a/internal/version/version.go b/internal/version/version.go index 939ec84..01e6da8 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -11,7 +11,7 @@ var ( // Version is the semantic version (injected via ldflags). // Development default: "v0.1.0-dev". // Release builds inject: "v0.1.0". - Version = "v0.1.0-dev" + Version = "dev" // GitCommit is the git commit hash (short form). // Injected via ldflags during build. diff --git a/internal/web/assets/static/app.css b/internal/web/assets/static/app.css index 00b4694..5c05c82 100644 --- a/internal/web/assets/static/app.css +++ b/internal/web/assets/static/app.css @@ -1,26 +1,26 @@ /* ── Fonts ───────────────────────────────────────────────────────────── */ @font-face { - font-family: "iA Writer Quattro"; - src: url("/static/fonts/iAWriterQuattroS-Regular.woff2") format("woff2"); + font-family: "Space Grotesk"; + src: url("/static/fonts/SpaceGrotesk-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, - U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, + U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "iA Writer Quattro"; - src: url("/static/fonts/iAWriterQuattroS-Bold.woff2") format("woff2"); + font-family: "Space Grotesk"; + src: url("/static/fonts/SpaceGrotesk-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, - U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, + U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { - font-family: "iA Writer Mono"; - src: url("/static/fonts/iAWriterMonoS-Regular.woff2") format("woff2"); + font-family: "Space Mono"; + src: url("/static/fonts/SpaceMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, - U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, + U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @@ -68,8 +68,8 @@ --radius-sm: 4px; --radius-md: 6px; --radius-pill: 999px; - --font-body: "iA Writer Quattro", system-ui, sans-serif; - --font-mono: "iA Writer Mono", ui-monospace, Menlo, monospace; + --font-body: "Space Grotesk", system-ui, sans-serif; + --font-mono: "Space Mono", ui-monospace, Menlo, monospace; --transition-fast: 120ms ease; } @@ -501,3 +501,27 @@ dialog#add-modal select { margin-top: var(--space-4); justify-content: flex-end; } + +/* ── Footer ──────────────────────────────────────────────────────────── */ +.app-footer { + display: flex; + align-items: center; + justify-content: center; + gap: var(--space-4); + padding: var(--space-2) var(--space-4); + border-top: 1px solid var(--color-border); + font-family: var(--font-mono); + font-size: var(--font-size-xs); + color: var(--color-text-muted); + flex-shrink: 0; +} + +.app-footer-link { + color: var(--color-text-muted); + text-decoration: none; +} + +.app-footer-link:hover { + color: var(--color-text); + text-decoration: underline; +} diff --git a/internal/web/assets/static/fonts/OFL.txt b/internal/web/assets/static/fonts/OFL.txt deleted file mode 100644 index 5cd41aa..0000000 --- a/internal/web/assets/static/fonts/OFL.txt +++ /dev/null @@ -1,100 +0,0 @@ -# iA Writer Typeface - -Copyright © 2018 Information Architects Inc. with Reserved Font Name "iA Writer" - -# Based on IBM Plex Typeface - -Copyright © 2017 IBM Corp. with Reserved Font Name "Plex" - -# License - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/internal/web/assets/static/fonts/SpaceGrotesk-Bold.woff2 b/internal/web/assets/static/fonts/SpaceGrotesk-Bold.woff2 new file mode 100644 index 0000000..44604a0 Binary files /dev/null and b/internal/web/assets/static/fonts/SpaceGrotesk-Bold.woff2 differ diff --git a/internal/web/assets/static/fonts/SpaceGrotesk-Regular.woff2 b/internal/web/assets/static/fonts/SpaceGrotesk-Regular.woff2 new file mode 100644 index 0000000..0f3474e Binary files /dev/null and b/internal/web/assets/static/fonts/SpaceGrotesk-Regular.woff2 differ diff --git a/internal/web/assets/static/fonts/SpaceMono-Regular.woff2 b/internal/web/assets/static/fonts/SpaceMono-Regular.woff2 new file mode 100644 index 0000000..2752f60 Binary files /dev/null and b/internal/web/assets/static/fonts/SpaceMono-Regular.woff2 differ diff --git a/internal/web/assets/static/fonts/iAWriterMonoS-Regular.woff2 b/internal/web/assets/static/fonts/iAWriterMonoS-Regular.woff2 deleted file mode 100644 index 5c36051..0000000 Binary files a/internal/web/assets/static/fonts/iAWriterMonoS-Regular.woff2 and /dev/null differ diff --git a/internal/web/assets/static/fonts/iAWriterQuattroS-Bold.woff2 b/internal/web/assets/static/fonts/iAWriterQuattroS-Bold.woff2 deleted file mode 100644 index d4c3f63..0000000 Binary files a/internal/web/assets/static/fonts/iAWriterQuattroS-Bold.woff2 and /dev/null differ diff --git a/internal/web/assets/static/fonts/iAWriterQuattroS-Regular.woff2 b/internal/web/assets/static/fonts/iAWriterQuattroS-Regular.woff2 deleted file mode 100644 index a25cdbc..0000000 Binary files a/internal/web/assets/static/fonts/iAWriterQuattroS-Regular.woff2 and /dev/null differ diff --git a/internal/web/assets/templates/index.html b/internal/web/assets/templates/index.html index 08f2802..7b2945a 100644 --- a/internal/web/assets/templates/index.html +++ b/internal/web/assets/templates/index.html @@ -31,5 +31,6 @@
+ {{template "footer" .}} {{end}} diff --git a/internal/web/assets/templates/partial_footer.html b/internal/web/assets/templates/partial_footer.html new file mode 100644 index 0000000..00fd130 --- /dev/null +++ b/internal/web/assets/templates/partial_footer.html @@ -0,0 +1,6 @@ +{{define "footer"}} + +{{end}} diff --git a/internal/web/handlers.go b/internal/web/handlers.go index 3949846..46e99aa 100644 --- a/internal/web/handlers.go +++ b/internal/web/handlers.go @@ -11,6 +11,7 @@ import ( "github.com/asphaltbuffet/wherehouse/internal/app" "github.com/asphaltbuffet/wherehouse/internal/inventory" "github.com/asphaltbuffet/wherehouse/internal/store" + "github.com/asphaltbuffet/wherehouse/internal/version" ) const ( @@ -78,7 +79,11 @@ func (s *Server) handleIndex(w http.ResponseWriter, r *http.Request) { } } - data := struct{ Roots []app.EntityResult }{Roots: roots} + data := indexData{ + Roots: roots, + Version: version.Version, + GitCommit: version.GitCommit, + } s.renderHTML(w, "index", data) } @@ -114,6 +119,12 @@ func (s *Server) handleTreeChildren(w http.ResponseWriter, r *http.Request) { } } +type indexData struct { + Roots []app.EntityResult + Version string + GitCommit string +} + // handleEntityDetail returns the detail pane fragment for a single entity. type detailData struct { Entity app.EntityResult diff --git a/mise.toml b/mise.toml index bf6296d..2352e92 100644 --- a/mise.toml +++ b/mise.toml @@ -8,7 +8,16 @@ semver = "latest" [tasks.build] description = "go build" -run = "go build -o dist/ ./..." +run = ''' +#!/usr/bin/env bash +VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "v0.0.0-dev") +COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") +DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) +PKG="github.com/asphaltbuffet/wherehouse/internal/version" +go build \ + -ldflags "-X ${PKG}.Version=${VERSION} -X ${PKG}.GitCommit=${COMMIT} -X ${PKG}.BuildDate=${DATE}" \ + -o dist/ ./... +''' [tasks.ci] description = "CI build pipeline"