publish¶
Generate the Hugo/PaperMod report index and per-repo detail pages from the stored analyses.
It reads the latest analysis per repository (and per project, for multi-module repos) from Postgres and writes Hugo content — an index page plus a detail page per repo/project with a CRAP-score trend sparkline — into the output directory.
Flags¶
| Flag | Default | Description |
|---|---|---|
--out |
content/reports |
Hugo content output directory. |
--base-url |
(empty) | Blog base URL (reserved). |
--exclude-errors |
true |
Skip failed analyses in the report. |
Example¶
# write reports into the Hugo site's content tree
./go-crap-tracker publish --out pages/content/reports
# include failed analyses too
./go-crap-tracker publish --exclude-errors=false
Hugo requirement¶
The per-repo trend sparkline is inline SVG. For it to render, your Hugo config must allow raw HTML:
Output¶
<out>/
_index.md # report index — one row per repo/project, latest score + trend
<slug>/
_index.md # detail page for the repo root project (CRAP history sparkline)
<slug>-<project>/
_index.md # detail page for one project of a multi-module repo
The slug is the repo's org/repo with a dash (microsoft/typescript → microsoft-typescript); each project appends its subdirectory (…/TypeScript + tools → microsoft-typescript-tools/). Project pages carry a **Project**:tools`` line, and their trend sparkline shows only that project's history.
Related¶
- Repo Cache — the data that feeds these reports.
- HTTP API —
GET /api/reposreturns the same latest-per-repo data as JSON.