← repoman internals

frontend

import "git.griefed.de/griefed/repoman/frontend"
package frontend // import "git.griefed.de/griefed/repoman/frontend"

Package frontend embeds repoman's web frontend — the html/template pages
(web/templates), the static assets (web/static: CSS, the app.js ES module,
icons), the built-in theme files (web/themes), and the in-app help manual
(web/help: the Markdown topic files) — so the binary ships them with no files
needed alongside it.

The assets live here, at the repo's top level next to their Vitest tests,
rather than beside the Go handlers, because go:embed can only reach files at
or below the embedding source file. The server's handlers package imports this
package for the embedded FS; there is no import cycle because frontend imports
nothing of repoman's.

VARIABLES

var WebFS embed.FS
    WebFS holds the embedded web/ tree: web/templates (parsed by the handlers
    package into the page template set), web/static (served under /static),
    web/themes (the built-in theme files, parsed by internal/theme at startup
    and served as part of the generated /themes.css stylesheet), and web/help
    (the Markdown help topics, loaded and rendered by internal/help at startup).
    It is consumed by internal/server/handlers — read files from it there, not
    directly elsewhere, so the embed stays the single source of the asset paths.