feat: generate the gt command reference from gitea/cli

update_cli_docs.sh runs gt's own generator and lays the pages out for the
site: one directory per command group, front matter, titles, sidebar
order, fenced help text and rewritten links. --released succeeds while no
series is documented. A weekly workflow proposes updates like the runner's.

Signed-off-by: bircni <[email protected]>
This commit is contained in:
bircni committed 2026-10-22 11:28:15 +02:00
1 parent fe618c42be
commit 55c3a392a1
261 files changed
+15116 -2

No files matched your search

+34 -1
View File
@@ -3,13 +3,14 @@
The sources of [docs.gitea.com](https://docs.gitea.com), built with
[Astro](https://astro.build) and [Starlight](https://starlight.astro.build).
The site covers three products, all served from this repository:
The site covers four products, all served from this repository:
| Product | Content | Versions | Languages |
| --- | --- | --- | --- |
| Docs | `docs/`, `versioned_docs/`, `i18n/` | next, 28, 1.27 … 1.22 | English, 简体中文, 繁體中文 |
| API | `static/swagger-*.json`, `static/openapi3-*.json` | next, 28, 1.27 … 1.22 | English |
| Runner | `runner-docs/`, `runner-docs_versioned_docs/` | develop, 5 … 0 | English |
| CLI | `cli-docs/`, `cli-docs_versioned_docs/` | develop | English |
The enterprise documentation is built and deployed from its own repository and
reached through `/enterprise/`, which a Cloudflare worker maintained elsewhere
@@ -53,6 +54,7 @@ group from the `_category_.json` of its directory.
```shell
make cut-version PRODUCT=docs VERSION=1.28
make cut-version PRODUCT=runner VERSION=6
make cut-version PRODUCT=cli VERSION=0.1
```
This freezes the current tree, its translations and its sidebar. The label of
@@ -115,6 +117,37 @@ workflow runs weekly and opens a pull request whenever the runner's CLI or
example configuration changed. Generating them needs Go, since the script builds
the runner binary.
## CLI docs
The documentation of `gt`, the Gitea CLI from
[gitea/cli](https://gitea.com/gitea/cli), is laid out like the runner docs:
| Version | Content | URL |
| --- | --- | --- |
| develop | `cli-docs/` | `/cli/` until the first release, then `/cli/develop/` |
| current series | `cli-docs_versioned_docs/version-<series>/` | `/cli/` |
| older series | `cli-docs_versioned_docs/version-<series>/` | `/cli/<series>/` |
No series is documented yet. Once a release exists, cut its series with
`make cut-version PRODUCT=cli VERSION=0.1`, then list it in `cliSeries` in
`packages/content-loader/src/products.ts`; the develop docs then move to
`/cli/develop/`. Its sidebar is written by hand in `cli-sidebars.js`, apart from
the reference, which is laid out from its directory tree.
The pages under `reference/` are generated with gt's own generator
(`go run ./tools/cli-docs`), one page per command and help topic, with a command
that has subcommands turned into a directory:
```shell
make update-cli-docs # develop docs, from the main branch of gitea/cli
make update-cli-docs-released # every series, from its newest stable tag
./update_cli_docs.sh v0.1.0 cli-docs_versioned_docs/version-0.1/reference
```
`CLI_REMOTE` points the script at another clone, such as a local checkout. The
`update cli reference` workflow refreshes the pages weekly, like the runner's.
Generating them needs Go.
## Deployment
`main` is built and published by the `Build and Publish Docs site` workflow, to