From c87f83180a8a551c803b7b08e0d2a68b6c36972f Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Mon, 23 Nov 2026 12:21:45 +0000 Subject: [PATCH] feat/legacy-docs: Point legacy docs readers to the new docs --- src/components/Layout.tsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index ffd655fcd..d3d806345 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -103,9 +103,33 @@ function Header() { ); } +// Only on docs-legacy.sourcegraph.com. The same deployment also serves +// sourcegraph.com/docs (until the new docs take over) and ms-docs.sg.dev. +function LegacyBanner() { + const [show, setShow] = useState(false); + useEffect(() => { + setShow(window.location.hostname === 'docs-legacy.sourcegraph.com'); + }, []); + if (!show) return null; + return ( +

+ You’re viewing the legacy Sourcegraph documentation, which is no + longer updated. See the{' '} + + new documentation + + . +

+ ); +} + export function Layout({children}: {children: React.ReactNode}) { return (
+