diff --git a/app/components/MovedNotice.tsx b/app/components/MovedNotice.tsx new file mode 100644 index 0000000..3dc9597 --- /dev/null +++ b/app/components/MovedNotice.tsx @@ -0,0 +1,56 @@ +"use client"; + +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { useEffect } from "react"; + +type MovedNoticeProps = { + /** Where this page's content now lives. */ + href: string; + /** Human-readable name of the destination page. */ + title: string; +}; + +/** + * Stands in for a page whose content has been superseded by another page. + * + * The obvious implementation is `redirect()` in the server component, and this + * replaces exactly that. It cannot work here: the site is exported as static + * HTML (`output: "export"`), so there is no server to issue a 3xx, and Next + * renders the thrown redirect as an error document instead. The result was a + * page that returned HTTP 200 with an empty `__next_error__` body while still + * being listed in sitemap.xml and linked from two live pages, so both readers + * and crawlers hit a dead end. + * + * Rendering real markup serves both: a crawler sees a working link to the + * replacement, and a reader who followed a bookmark is forwarded once the + * bundle hydrates. + */ +export default function MovedNotice({ href, title }: MovedNoticeProps) { + const router = useRouter(); + + useEffect(() => { + router.replace(href); + }, [href, router]); + + return ( +
+ Its content now lives in{" "} + + {title} + + . You should be redirected automatically. +
+ + Continue to {title} + +
- Use the commands below to discover available versions before pinning. The
- examples name the extension package; substitute{" "}
- {selectedPackageNames} to pin the package
- your selected target actually installs. Replace{" "}
- <VERSION> with the version string
- shown by the list command (e.g.{" "}
- {repoAptVersionExample} for APT,{" "}
- {repoRpmVersionExample} for RPM). The
- package repositories can lag the newest GitHub release, so pin to a version the
- list command actually shows.
+ Use the commands below to discover available versions before pinning, and pin{" "}
+ {selectedPackageNames} — the package your
+ selected target actually installs.
+
+ The two package families carry different version strings, so the
+ right <VERSION> depends on which you
+ pin. The extension is{" "}
+ {repoAptVersionExample} (APT) /{" "}
+ {repoRpmVersionExample} (RPM), while{" "}
+ documentdb,{" "}
+ documentdb-<pg> and the gateway are{" "}
+ {release.metaVersion} (APT) /{" "}
+ {release.metaRpmVersion} (RPM). Pinning{" "}
+ documentdb-18={repoAptVersionExample}{" "}
+ fails — always take the string the list command prints.
APT — list then pin
- apt-cache madison postgresql-18-documentdb
+ apt-cache madison {selectedPackageNames}
- sudo apt install postgresql-18-documentdb=<VERSION>
+ sudo apt install {selectedPackageNames}=<VERSION>
RPM — list then pin
- dnf --showduplicates list postgresql18-documentdb
+ dnf --showduplicates list {selectedPackageNames}
- sudo dnf install postgresql18-documentdb-<VERSION>
+ sudo dnf install {selectedPackageNames}-<VERSION>