Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
46 changes: 35 additions & 11 deletions internal/web/assets/static/app.css
Original file line number Diff line number Diff line change
@@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
100 changes: 0 additions & 100 deletions internal/web/assets/static/fonts/OFL.txt

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions internal/web/assets/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
<dialog id="add-modal" aria-label="Add item">
<div id="add-modal-body"></div>
</dialog>
{{template "footer" .}}
</body>
</html>{{end}}
6 changes: 6 additions & 0 deletions internal/web/assets/templates/partial_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{define "footer"}}
<footer class="app-footer">
<span class="app-footer-version">{{.Version}}+{{.GitCommit}}</span>
<a class="app-footer-link" href="https://github.com/asphaltbuffet/wherehouse" target="_blank" rel="noopener">GitHub</a>
</footer>
{{end}}
13 changes: 12 additions & 1 deletion internal/web/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading