修复撤下 Endor 导航后历史页面的空值访问 #53

Merged
Zayden-Jung merged 1 commits from codex/archived-doc-render into main 2026-11-05 14:29:52 +00:00
+2 -1
View File
@@ -58,7 +58,8 @@ export default function DocPage({
const [active, setActive] = useState("");
const siblings = docs.filter((d) => d.collection === doc.collection);
const collectionEntry = collectionEntries(docs).find((c) => c.name === doc.collection)!.entry;
// Historical pages remain readable even when their collection is outside the catalog.
const collectionEntry = collectionEntries(docs).find((c) => c.name === doc.collection)?.entry ?? doc;
const index = siblings.findIndex((d) => d.slug === doc.slug);
useEffect(() => {
const observer = new IntersectionObserver(