From b555a247e09b62c5fd2d93f50b8c641e457ab422 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 15 Oct 2026 17:39:24 +0000 Subject: [PATCH] refactor: drop the remaining docusaurus names from identifiers and comments (#589) Follow-up to #588. - rename `DocusaurusSidebarItem` -> `SidebarSourceItem`, `fromDocusaurus` -> `fromSidebarSource`, `docusaurusSidebars` -> `sidebarSources` - reword comments and READMEs that described behaviour by comparison with docusaurus; fix the stale note in `sites/docs/src/config/api.ts` - drop `.docusaurus/` from `.gitignore` No functional change. `pnpm check` has 0 errors and `pnpm build` still builds 6690 pages. Preview: https://pr-589.docs-gitea-com.pages.dev Reviewed-on: https://gitea.com/gitea/docs/pulls/589 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com> --- .gitignore | 1 - cloudflare/_headers | 4 +-- cloudflare/_redirects | 2 +- packages/content-loader/src/categories.ts | 4 +-- packages/content-loader/src/index.ts | 8 ++--- packages/content-loader/src/links.ts | 4 +-- packages/content-loader/src/markdown.ts | 6 ++-- packages/content-loader/src/products.ts | 2 +- packages/content-loader/src/segments.ts | 5 ++-- packages/content-loader/src/sidebar.ts | 30 +++++++++---------- scripts/cut-version.mjs | 2 +- sites/docs/README.md | 6 ++-- .../docs/src/components/MarkdownContent.astro | 2 +- sites/docs/src/config/api.ts | 2 +- sites/docs/src/lib/sidebars.ts | 16 +++++----- 15 files changed, 46 insertions(+), 48 deletions(-) diff --git a/.gitignore b/.gitignore index f3c24951..80f11cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ sites/*/dist sites/*/.astro sites/*/.cache build/ -.docusaurus/ # Misc .DS_Store diff --git a/cloudflare/_headers b/cloudflare/_headers index a37ea054..7653e226 100644 --- a/cloudflare/_headers +++ b/cloudflare/_headers @@ -2,8 +2,8 @@ # is copied into the build output by the publish workflow, so that it is not # uploaded to S3/CloudFront where it would be publicly readable at /_headers. # -# Unlike the docusaurus build, astro emits a single content hashed asset -# directory shared by every language, so no per locale rules are needed. +# The build emits a single content hashed asset directory shared by every +# language, so no per locale rules are needed. # Content hashed build output (js, css, fonts). The file name changes with the # content, so these can be cached forever. diff --git a/cloudflare/_redirects b/cloudflare/_redirects index 07d47db9..d758d5ef 100644 --- a/cloudflare/_redirects +++ b/cloudflare/_redirects @@ -1,7 +1,7 @@ # Redirects for legacy URLs and routes the site no longer serves directly. # The api reference and the runner docs are separate products, published in -# english only. Docusaurus served an empty localized copy of them. +# english only, so they have no localized copy. /zh-cn/api/* /api/:splat 301 /zh-tw/api/* /api/:splat 301 /zh-cn/runner/* /runner/:splat 301 diff --git a/packages/content-loader/src/categories.ts b/packages/content-loader/src/categories.ts index 681b36cb..b49a9033 100644 --- a/packages/content-loader/src/categories.ts +++ b/packages/content-loader/src/categories.ts @@ -2,7 +2,7 @@ import { promises as fs } from 'node:fs'; import path from 'node:path'; import type { Segment } from './segments.js'; -/** `_category_.json`, the docusaurus per directory sidebar metadata. */ +/** `_category_.json`, the per directory sidebar metadata. */ export interface CategoryMeta { label?: string; position?: number; @@ -41,7 +41,7 @@ export function slugifyLabel(label: string): string { } /** - * Route id of the index page docusaurus generates for a category. + * Route id of the index page generated for a category. * * Top level categories are declared by `sidebars.js` without a slug and end up * under `/category/