28 Commits
Author SHA1 Message Date
Lunny Xiaoandbircni b137a0e0e1 Rebuild the site with Astro and Starlight (#496)
Replace [#307](https://gitea.com/gitea/docs/issues/307)
Closes [#237](https://gitea.com/gitea/docs/issues/237)

## Summary

Rebuilds docs.gitea.com with [Astro](https://astro.build) and [Starlight](https://starlight.astro.build), replacing Docusaurus. Every
published url keeps working and no content file was moved: the site is a new rendering layer over the existing `docs/`, `versioned_docs/`, `i18n/`, `runner-docs/` and `static/swagger-*.json` trees.

For the first time the API reference is part of the site rather than a Redoc
bundle: all seven swagger documents are rendered into real pages, one per
operation, so they are linkable, crawlable and searchable.

## Why

- the Docusaurus build needs an 8 GB heap and about 2 minutes for 2478 pages;
  the Astro build produces 5751 pages, API reference included, in about 100
  seconds
- the API reference was a single client rendered Redoc page per version, absent
  from the site search and from search engines
- sidebars, version lists and language lists were configured in three different
  places and drifted apart

## What is in here

- **`packages/content-loader`** — the product × version × language matrix
  (`products.ts`) and an Astro content loader that reads the existing markdown
  trees directly. The matrix is the single source of truth: content loading,
  sidebars, the version and language pickers, the version banner, the search
  facets and the API schemas are all derived from it.
- **Content compatibility** — frontmatter `slug`, `sidebar_position` and
  `sidebar_label` keep working, `_category_.json` still drives sidebar labels,
  order and the generated category pages, `@version@` style release variables are
  still substituted, `:::note` admonitions become Starlight asides and the 2778
  relative `*.md` links are rewritten to urls while the site is built.
- **API reference** — `starlight-openapi` renders the seven swagger documents.
  Operation urls are hyphenated (`/api/operations/list-admin-workflow-jobs/`),
  the sidebar shows the operations of the version being read with a coloured
  HTTP method badge, and the overview page links to one page per tag instead of
  repeating all 484 operations.
- **Navigation** — a version picker that follows the reader to the same page in
  another version, a language picker that only offers the languages the current
  product is published in, and product links for Docs, API, Runner and
  Enterprise.
- **Theme** — the light and dark palettes of about.gitea.com, mapped onto the
  Starlight variables.
- **Search** — Pagefind by default; Algolia DocSearch takes over when
  `PUBLIC_DOCSEARCH_APP_ID` and `PUBLIC_DOCSEARCH_API_KEY` are set. Every page
  carries `docsearch:product`, `docsearch:version` and `docsearch:language` meta
  tags, so a search stays inside what is being read.
  `cloudflare/docsearch-crawler.json` holds the crawler configuration.

## Bugs fixed along the way

- `GET /user/applications/oauth2` and `GET /user/applications/oauth2/{id}` have
  operation ids that only differ in case, so they collapsed onto the same url
  and one of the two pages was silently dropped. They are now
  `user-get-oauth2-application` and `user-get-oauth2-application-by-id`.
- The API overview and every tag page were all titled "Overview".

## Url compatibility

The routes of both builds were compared page by page during the migration with
`scripts/url-diff.mjs`:

```
identical: 2368, missing: 0, accepted: 110, added: 3292
```

The 110 accepted ones are all redirected in `cloudflare/_redirects`: the
localized copies of the English-only API and Runner docs, the Docusaurus search
page, and `/1.27/`, `/runner/3/`, `/api/1.27/` which are aliases of the versions
served at the product root. The added ones are the API operation and tag pages
plus the routes the Starlight language fallback serves in English when a
translation is missing — Docusaurus answered those with a 404.

## Workflows

- `checks` builds the site and type checks it on every pull request
- `Build and Publish Docs site` publishes `sites/docs/dist` to S3/CloudFront and
  to Cloudflare Pages, and copies `cloudflare/_headers` and
  `cloudflare/_redirects` into the deployment
- `update swagger files` and `update runner reference` are unchanged, they only
  touch content
- `make cut-version PRODUCT=docs VERSION=1.28` replaces
  `docusaurus docs:version`

## Removed

`docusaurus.config.js`, the swizzled theme under `src/`, and the Docusaurus UI
translations (`i18n/*/code.json`, `i18n/*/docusaurus-theme-classic/`). The
strings those carried — the product names, the footer column titles and the
outdated translation notice — were ported to
`sites/docs/src/config/strings.ts`; Starlight ships the rest of its interface in
both Chinese locales. The documentation content itself is untouched.

## Follow ups

- nine relative links are broken in the sources and reported by every build, the
  same ones Docusaurus warned about; `GITEA_DOCS_STRICT_LINKS=true` turns them
  into an error once they are fixed
- `cloudflare/worker.js` has to be deployed for `/enterprise/` to keep resolving
- the Algolia index has to be created and crawled before the search credentials
  are set

## Testing

```shell
make install
make serve-fast   # english, the version served at the root
make serve        # the whole matrix
make build        # 5751 pages
make check        # 0 errors
make serve-built  # build and serve, the only way to try the search locally
```

## Screenshots

<img width="1371" alt="image.png" src="attachments/69acdd77-cc89-4635-a8bd-1163a34afa86">

<img width="1810" alt="image.png" src="attachments/76212416-4825-4b4d-bf59-3e549900c96f">

<img width="1789" alt="image.png" src="attachments/7be84cda-5abe-48bd-8839-7ae1ee7806e7">

---------

Co-authored-by: bircni <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/496
Reviewed-by: bircni <[email protected]>
2026-08-12 20:03:29 +00:00
Lunny Xiao a1ef3a26ef Remove duplicated runner docs (#479)
The `usage/actions/runner` has duplicated runner documentations as `/runner`. This PR remove the duplicated content and leave obtain registry token in `usage/actions/runner` and runner install/configurations in `/runner`.

Reviewed-on: https://gitea.com/gitea/docs/pulls/479
Reviewed-by: silverwind <[email protected]>
2026-08-02 21:53:31 +00:00
Zettat123andLunny Xiao 1fb481c186 docs: add docs for scoped workflows (#447)
Related: https://github.com/go-gitea/gitea/pull/38154
---------

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/447
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2026-06-28 09:32:51 +00:00
54af905d63 rename act runner to runner (#390)
Depends on gitea/runner#850

---------

Co-authored-by: Nicolas <[email protected]>
Co-authored-by: silverwind <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/390
Reviewed-by: techknowlogick <[email protected]>
Reviewed-by: silverwind <[email protected]>
Reviewed-by: Nicolas <[email protected]>
2026-05-07 17:18:58 +00:00
Lunny Xiao 14b76120b4 update webhook documentation (#393)
Reviewed-on: https://gitea.com/gitea/docs/pulls/393
2026-05-01 16:40:27 +00:00
Lunny Xiao 826ff60fd4 Add missing translations (#305)
Reviewed-on: https://gitea.com/gitea/docs/pulls/305
2025-11-23 07:13:19 +00:00
SnowballXueQiuandLunny Xiao f12e3675b1 更新 i18n/zh-cn/docusaurus-plugin-content-docs/version-1.24/usage/actions/act-runner.md (#234)
Signed-off-by: SnowballXueQiu <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/234
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: SnowballXueQiu <[email protected]>
Co-committed-by: SnowballXueQiu <[email protected]>
2025-11-20 19:51:36 +00:00
Lunny Xiao 9baa98ec3f Move usage directories (#300)
Reviewed-on: https://gitea.com/gitea/docs/pulls/300
2025-11-20 19:49:24 +00:00
Lunny Xiao dcb9b9b450 Use category instead of place holder markdown file as directory (#299)
Reviewed-on: https://gitea.com/gitea/docs/pulls/299
2025-11-20 18:02:34 +00:00
appleboy dbfa0ba454 docs: add zh-tw folder (#195)
Signed-off-by: appleboy <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/195
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: appleboy <[email protected]>
Co-committed-by: appleboy <[email protected]>
2025-04-04 23:28:16 +00:00
Zettat123andLunny Xiao 8f872a636d Document for GITEA_RUNNER_REGISTRATION_TOKEN env (#132)
Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/132
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2024-12-24 20:32:57 +00:00
TheFox0x7 7a4e79c937 use fqin for container images (#125)
It's generally considered a better practice and it's more portable allowing podman to work without having to modify the name.

Reviewed-on: https://gitea.com/gitea/docs/pulls/125
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: TheFox0x7 <[email protected]>
Co-committed-by: TheFox0x7 <[email protected]>
2024-12-17 20:23:46 +00:00
Lunny Xiao ddc1db3637 Move authentication from usage to administration (#105)
Reviewed-on: https://gitea.com/gitea/docs/pulls/105
2024-11-24 02:32:42 +00:00
e8344b03cb Document Reverse Proxy authentication for API (#84)
I figured out that the reverse proxy authentication for the API is supported (implemented with https://github.com/go-gitea/gitea/pull/26703). This will update the documentation to the current state.

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: Philipp Arndt <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/84
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: philipparndt <[email protected]>
Co-committed-by: philipparndt <[email protected]>
2024-11-12 19:35:18 +00:00
Lunny Xiao 05271fd4e6 Update faq for actions to correct wrong documentations. (#85)
- [x] User-level runners are supported from 1.20
- [x] Actions are enabled by default from 1.21

Reviewed-on: https://gitea.com/gitea/docs/pulls/85
2024-10-28 18:04:52 +00:00
Lunny Xiao 5f07f6c79a Update old versions 2024-10-11 00:06:36 -07:00
Lunny Xiao 1257064c05 Improve agit usage (#63)
Reviewed-on: https://gitea.com/gitea/docs/pulls/63
2024-09-06 19:46:32 +00:00
Lunny Xiao 97339dc250 Remove unnecessary _index.md 2024-09-02 17:57:43 -07:00
Lunny Xiao 7a8bc94a8a Adjust packages and actions articles' sequence on the sidebar 2024-09-02 17:52:58 -07:00
pangliangandpangliang 9003c4a604 'workflow_dispatch' unsupported description removed (#54)
For PR: [go-gitea/gitea#28163](https://github.com/go-gitea/gitea/pull/28163)

I saw that there was no description of the use of a single syntax in the original document, so I simply deleted the description that 'workflow_dispatch does not support'

Co-authored-by: pangliang <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/54
Reviewed-by: Denys Konovalov <[email protected]>
Reviewed-by: techknowlogick <[email protected]>
Co-authored-by: pangliang <[email protected]>
Co-committed-by: pangliang <[email protected]>
2024-08-19 20:31:59 +00:00
Zettat123 56e5cc026b Update issue template for issue assignees (#48)
Related to https://github.com/go-gitea/gitea/pull/31083

Reviewed-on: https://gitea.com/gitea/docs/pulls/48
Reviewed-by: Jason Song <[email protected]>
Co-authored-by: Zettat123 <[email protected]>
Co-committed-by: Zettat123 <[email protected]>
2024-08-13 02:27:18 +00:00
Lunny Xiao af22422e1a Update meta data of docs 2024-08-06 16:44:42 -07:00
Lunny Xiao 7e77e7fb39 Add missing doc from main repository (#4)
Copy from https://github.com/go-gitea/gitea/pull/31211/files
Author: @MaxWipfli

Add missing documentation for https://github.com/go-gitea/gitea/pull/30268

Reviewed-on: https://gitea.com/gitea/docs/pulls/4
2024-06-15 03:10:51 +00:00
Lunny Xiao ab2cdde840 Fix more links and problems (#3)
Reviewed-on: https://gitea.com/gitea/docs/pulls/3
2024-06-14 08:53:10 +00:00
Lunny Xiao 9a8396aa29 Fix broken links (#1)
- Always use a relative markdown link so that we can jump even if we edit it in local env or read it in code hosting server.

Reviewed-on: https://gitea.com/gitea/docs/pulls/1
2024-06-14 05:53:15 +00:00
Lunny Xiao b4dddf8804 Use docusaurus warning/note syntax instead markdown 2024-06-07 18:03:08 +08:00
Lunny Xiao 91cd95dba0 Fix links 2024-06-07 00:21:50 +08:00
Lunny Xiao b9e0a85c9b Use a formal docusaurus i18n structure 2024-06-06 20:44:06 +08:00