You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2026/08/13 09:29:11 UTC

(fory-site) 01/02: fix: redirect legacy and missing routes

This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch fix_broken_links
in repository https://gitbox.apache.org/repos/asf/fory-site.git

commit d0055b447308cdc8300e22c199cf10f2ca0379a1
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Thu Aug 13 17:18:59 2026 +0800

    fix: redirect legacy and missing routes
---
 AGENTS.md                            |  7 +++++--
 src/pages/404.tsx                    | 22 ----------------------
 src/plugin/redirect.js               |  1 +
 src/theme/NotFound/Content/index.tsx | 11 +++++++++++
 4 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index ab1968986b..ffb1562047 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -26,7 +26,11 @@ Common commands (`package.json`):
 - `npm run start` / `npm run start-en` / `npm run start-zh`
 - `npm run build` (runs `prebuild` first)
 - `npm run docusaurus docs:version <ver>` (wrapped command with i18n version copy support)
-- `npm run typecheck`
+
+Agent command restriction:
+
+- Do not execute `npm run typecheck` unless the user explicitly reverses this
+  instruction. Use the permitted build and focused checks for validation.
 
 ## 3. Information Architecture and Directory Responsibilities
 
@@ -143,5 +147,4 @@ This means Chinese docs may be a mix of translated content and English fallback
   - Update `i18n/zh-CN/docusaurus-plugin-content-docs/current.json` (and version JSON files if needed)
 - Minimum pre-commit validation:
   - `npm run build`
-  - `npm run typecheck`
   - Manually verify critical routes: `/`, `/docs`, `/zh-CN/docs`, `/blog`
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
deleted file mode 100644
index 6a7091f214..0000000000
--- a/src/pages/404.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import React, { useEffect } from "react";
-import { useHistory } from "@docusaurus/router";
-
-export default function NotFound() {
-  const history = useHistory();
-  useEffect(() => {
-    const pathname = window.location.pathname;
-    const locale =
-      pathname.match(/^\/[a-z]{2}-[A-Z]{2}(?:\/|$)/)?.[0].replace(/\/$/, "") ??
-      "";
-    const docs = pathname.match(
-      /^((?:\/[a-z]{2}-[A-Z]{2})?\/docs)(\/next)?(?:\/|$)/,
-    );
-    const start = docs
-      ? `${docs[1]}${docs[2] ?? ""}/start`
-      : `${locale}/docs/start`;
-    history.replace(
-      pathname === start || pathname === `${start}/` ? `${locale}/` : start,
-    );
-  }, [history]);
-  return null;
-}
diff --git a/src/plugin/redirect.js b/src/plugin/redirect.js
index 7a58c6d8c6..ead2d8e7f1 100644
--- a/src/plugin/redirect.js
+++ b/src/plugin/redirect.js
@@ -86,6 +86,7 @@ export default function (context, options) {
                   'guide/xlang/getting_started': 'object-serialization/xlang',
                   'guide/xlang/serialization': 'object-serialization/xlang',
                   'guide/java/json_support': 'json',
+                  'guide/rust': 'object-serialization/rust',
                   'guide/rust/external_types': 'object-serialization/rust/external-types',
                   'guide/dart/external_types': 'object-serialization/dart/external-types',
                   'guide/swift/external_types': 'object-serialization/swift/external-types',
diff --git a/src/theme/NotFound/Content/index.tsx b/src/theme/NotFound/Content/index.tsx
new file mode 100644
index 0000000000..ea8974415d
--- /dev/null
+++ b/src/theme/NotFound/Content/index.tsx
@@ -0,0 +1,11 @@
+import { useEffect, type ReactNode } from 'react';
+
+export default function NotFoundContent(): ReactNode {
+  useEffect(() => {
+    // Docusaurus' catch-all route and missing-doc fallback both render this
+    // theme slot; a src/pages/404.tsx file only creates a normal /404 route.
+    window.location.replace('https://fory.apache.org/');
+  }, []);
+
+  return null;
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org