From 2584c3d18e5afe888fa4b3f9c11ce10d63b923b0 Mon Sep 17 00:00:00 2001 From: fylorn <249551762+fylorn@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:16:10 +0800 Subject: [PATCH] Give ThinkWatch Enterprise its own docs home The documentation home became a hub for all three products, but it was still ThinkWatch Enterprise's docs home: its "Open docs" link, its pill in the product switcher and "Overview" in its sidebar all led back to the hub. Enterprise now has an overview page at /docs/overview, like the overview pages of Lite and Core, and every link to its docs home points there. Its guides keep their /docs/ addresses. - The Enterprise page's docs button leads to the overview too. - "Edit on GitHub" on Enterprise docs points at this repository, where they live; the ThinkWatch repository's docs folder no longer has them. - The hub is no longer indexed as an Enterprise page in search. Co-Authored-By: Claude Opus 5.5 --- src/components/SiteHeader.astro | 5 +++-- src/components/pages/ThinkWatchPage.astro | 3 ++- src/content/docs/_meta.ts | 17 ++++++++++----- src/content/docs/en/overview.md | 25 +++++++++++++++++++++++ src/content/docs/zh-CN/overview.md | 25 +++++++++++++++++++++++ src/layouts/DocsLayout.astro | 4 ++-- src/pages/docs/_DocArticle.astro | 6 ++---- src/pages/docs/_lib.ts | 13 ++++++------ src/pages/docs/overview.astro | 10 +++++++++ src/pages/zh-CN/docs/overview.astro | 10 +++++++++ 10 files changed, 98 insertions(+), 20 deletions(-) create mode 100644 src/content/docs/en/overview.md create mode 100644 src/content/docs/zh-CN/overview.md create mode 100644 src/pages/docs/overview.astro create mode 100644 src/pages/zh-CN/docs/overview.astro diff --git a/src/components/SiteHeader.astro b/src/components/SiteHeader.astro index 262670a..07ca3b3 100644 --- a/src/components/SiteHeader.astro +++ b/src/components/SiteHeader.astro @@ -1,7 +1,7 @@ --- import { getLang, t, localePath, type Lang } from "~/i18n"; import { getStarCount, formatStars } from "~/lib/github"; -import { findDoc } from "~/content/docs/_meta"; +import { findDoc, getProduct } from "~/content/docs/_meta"; import SearchModal from "./SearchModal.astro"; import TwMark from "./TwMark.astro"; @@ -44,7 +44,8 @@ function targetPath(target: Lang): string { if (/^\/404(\.html)?\/?$/.test(cleanPath)) return "/"; if (currentDocMeta && !currentDocMeta.locales.includes(target)) { // Untranslated doc: fall back to that product's docs home. - return docMatch?.[1] ? `/docs/${docMatch[1]}` : "/docs"; + const product = getProduct((docMatch?.[1] as "lite" | "core" | undefined) ?? "thinkwatch"); + return product.home ?? product.base; } return cleanPath; } diff --git a/src/components/pages/ThinkWatchPage.astro b/src/components/pages/ThinkWatchPage.astro index 572b07b..4d3e3d8 100644 --- a/src/components/pages/ThinkWatchPage.astro +++ b/src/components/pages/ThinkWatchPage.astro @@ -14,6 +14,7 @@ import QuickStart from "~/components/sections/QuickStart.astro"; import LogExplorerMock from "~/components/mocks/LogExplorerMock.tsx"; import NeonMotion from "~/components/NeonMotion.astro"; import { getLang, localePath } from "~/i18n"; +import { productHomeHref } from "~/content/docs/_meta"; import { getLatestRelease } from "~/lib/github"; import { enterpriseLd } from "~/lib/structured-data"; import { thinkwatchCopy } from "~/i18n/pages/thinkwatch"; @@ -53,7 +54,7 @@ const delay = (i: number) => `animation-delay: ${i * 90}ms;`;

{c.hero.sub}