2026-08-29 00:19:06 +02:00
|
|
|
# yetano-webui-template
|
|
|
|
|
|
|
|
|
|
Shared server-rendered web UI chrome (base layout, navbar, sidebar,
|
|
|
|
|
footer) for the Yetano/Yak/Yamase family of ops-tool admin dashboards.
|
|
|
|
|
This is a real Go module (`teruna.dev/yetano/yetano-webui-template`,
|
|
|
|
|
package `layout`), imported by each dashboard rather than copy-pasted —
|
|
|
|
|
see `layout.go` for the API (`PageHeader`, `NavItem`, `NewRenderer`,
|
|
|
|
|
`StaticHandler`).
|
|
|
|
|
|
|
|
|
|
## Source of truth
|
|
|
|
|
|
2026-08-29 00:28:22 +02:00
|
|
|
This repo is the **source of truth** for the shared layout. `yak/yak-webui-template`
|
|
|
|
|
and `yamase/yamase-webui-template` are git-history mirrors of it (each repo's
|
|
|
|
|
root mirrors this repo's root — not a subdirectory — created via `git merge
|
|
|
|
|
--allow-unrelated-histories`, so the histories are related and can be
|
|
|
|
|
re-merged incrementally). Each mirror has exactly one intentional local
|
|
|
|
|
difference: its `go.mod` `module` line, which names that repo's own import
|
|
|
|
|
path instead of this one. Make layout changes *here first*, tag a new
|
|
|
|
|
version, then pull the change into each mirror — never edit the mirrored
|
|
|
|
|
copies directly.
|
2026-08-29 00:19:06 +02:00
|
|
|
|
2026-08-29 00:28:22 +02:00
|
|
|
### Pulling a change into a mirror
|
2026-08-29 00:19:06 +02:00
|
|
|
|
2026-08-29 00:28:22 +02:00
|
|
|
From inside `yak-webui-template` or `yamase-webui-template` (each already
|
|
|
|
|
has a `source` remote pointing back here):
|
2026-08-29 00:19:06 +02:00
|
|
|
|
|
|
|
|
```sh
|
2026-08-29 00:28:22 +02:00
|
|
|
git fetch source main
|
|
|
|
|
git merge source/main
|
|
|
|
|
# resolve the go.mod conflict: keep the mirror's own module line, take
|
|
|
|
|
# everything else from source
|
|
|
|
|
git checkout --ours go.mod # if go.mod conflicted
|
|
|
|
|
git add go.mod
|
|
|
|
|
git commit
|
|
|
|
|
go test ./...
|
2026-08-29 00:19:06 +02:00
|
|
|
git push origin main
|
|
|
|
|
```
|
|
|
|
|
|
2026-08-29 00:28:22 +02:00
|
|
|
### One-time mirror setup (already done, kept here for reference/re-setup)
|
2026-08-29 00:19:06 +02:00
|
|
|
|
|
|
|
|
```sh
|
2026-08-29 00:28:22 +02:00
|
|
|
git init -b main
|
|
|
|
|
git remote add source git@teruna.dev:yetano/yetano-webui-template.git
|
|
|
|
|
git fetch source main
|
|
|
|
|
git merge --allow-unrelated-histories -m "Initial mirror of yetano-webui-template" source/main
|
|
|
|
|
go mod edit -module teruna.dev/<org>/<org>-webui-template
|
|
|
|
|
git remote add origin git@teruna.dev:<org>/<org>-webui-template.git
|
|
|
|
|
git push -u origin main
|
2026-08-29 00:19:06 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## What's shared vs. what stays per-project
|
|
|
|
|
|
|
|
|
|
Shared here: the base HTML skeleton, navbar, sidebar (generic nav-item
|
|
|
|
|
list), footer, and the CSS rules that style exactly those elements
|
|
|
|
|
(`static/style.css` — theme root variables, navbar, `.sidebar .nav-link`
|
|
|
|
|
incl. the `#0b82b8` inactive-link color, footer, flash-banner alerts).
|
|
|
|
|
|
|
|
|
|
Stays in each consuming project: page-specific templates
|
|
|
|
|
(`templates/pages/*.html.tmpl`), page-content CSS (cards, tables, badges,
|
|
|
|
|
forms, buttons, markdown, ...), and anything else specific to that tool.
|
|
|
|
|
|
|
|
|
|
## Consuming this module
|
|
|
|
|
|
|
|
|
|
```go
|
|
|
|
|
type pageHeader = layout.PageHeader // embed this in your own page data structs
|
|
|
|
|
|
|
|
|
|
r, err := layout.NewRenderer(pagesFS, "templates/pages", pageNames, ".html.tmpl", template.FuncMap{
|
|
|
|
|
"buildInfo": func() string { return version.Get().Compact() },
|
|
|
|
|
})
|
|
|
|
|
...
|
|
|
|
|
mux.Handle("/webui-static/", layout.StaticHandler("/webui-static/"))
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
See `yetano/yasta` for a full worked example (the pilot migration of this
|
|
|
|
|
module).
|
|
|
|
|
|
|
|
|
|
## Migration status
|
|
|
|
|
|
|
|
|
|
| Project | Meta-repo | Status |
|
|
|
|
|
|---|---|---|
|
|
|
|
|
| `yasta` | yetano | migrated (pilot) |
|
|
|
|
|
| `yasl` | yetano | not yet migrated |
|
|
|
|
|
| `yaiam` | yetano | not yet migrated |
|
|
|
|
|
| `yakwui` | yak | not yet migrated |
|
|
|
|
|
| `yamase-web` | yamase | not yet migrated |
|