Compare commits

...

4 Commits

Author SHA1 Message Date
codex-bot 96dcbccbf6 Test live publication in a current document collection 2026-11-05 22:44:13 +08:00
Zayden-Jung d11b30f620 Merge pull request '修复撤下 Endor 导航后历史页面的空值访问' (#53) from codex/archived-doc-render into main
Verify and deploy Tabularium / verify-and-deploy (push) Failing after 11m26s
Reviewed-on: #53
2026-11-05 14:29:52 +00:00
codex-bot a4c9349fce Keep retired document pages readable outside the catalog 2026-11-05 22:27:12 +08:00
Zayden-Jung 4c4471c2bd Merge pull request '优先展示 Endorphin,撤下重复的 Endor 导航' (#52) from codex/endorphin-catalog into main
Verify and deploy Tabularium / verify-and-deploy (push) Failing after 10m31s
Reviewed-on: #52
2026-11-05 14:15:15 +00:00
2 changed files with 9 additions and 6 deletions
+7 -5
View File
@@ -196,6 +196,7 @@ async function main() {
const searchResponse = await request("/api/search", { headers });
assert.equal(searchResponse.status, 200);
const searchIndex = await searchResponse.json();
assert.ok(!searchIndex.some((doc: { collection: string }) => doc.collection === "Endor 文档"), "Retired Endor documents stay out of search");
assert.ok(searchIndex.some((doc: { slug: string; searchText: string }) => doc.slug === "source-studies/pretext/measurement-cache" && doc.searchText.includes("getSegmentMetrics")));
for (const doc of searchIndex as { slug: string; sourceSlug: string }[]) {
assert.ok(!doc.slug.split("/").some((part) => /^\d+-/.test(part)), doc.slug);
@@ -219,12 +220,13 @@ async function main() {
const sourceSlug = "ci-live-document";
const previous = readDocument(sourceSlug);
if (command === "exercise") {
const first = saveDocument({ slug: "endor/ci-live-document", sourceSlug,
title: "Runtime document", category: "Endor", collection: "Endor 文档", group: "CI",
// Publication is tested in a current collection; Endor is intentionally retired.
const first = saveDocument({ slug: "runtime-tests/ci-live-document", sourceSlug,
title: "Runtime document", category: "语言与运行时", collection: "运行时验证", group: "CI",
description: "Isolated smoke test", draft: true, featured: false,
content: "# Runtime document\n\nInitial body" }, previous?.revision ?? 0);
assert.equal((await request(`/docs/${first.slug}`, { headers })).status, 200);
saveDocument({ ...first, slug: "endor/ci-live-document-renamed", content: "# Runtime document\n\nUpdated without rebuilding" }, first.revision);
saveDocument({ ...first, slug: "runtime-tests/ci-live-document-renamed", content: "# Runtime document\n\nUpdated without rebuilding" }, first.revision);
}
const stored = readDocument(sourceSlug);
assert.ok(stored, "Smoke document must exist after creation or restart");
@@ -232,11 +234,11 @@ async function main() {
const live = await request(`/docs/${stored.slug}`, { headers });
assert.equal(live.status, 200);
assert.ok((await live.text()).includes("Updated without rebuilding"));
const alias = await request("/docs/endor/ci-live-document?live=1", { headers });
const alias = await request("/docs/runtime-tests/ci-live-document?live=1", { headers });
assert.equal(alias.status, 308);
assert.ok(alias.headers.get("location")?.includes("ci-live-document-renamed?live=1"));
const updatedIndex = await (await request("/api/search", { headers })).json();
assert.ok(updatedIndex.some((doc: { searchText: string }) => doc.searchText.includes("Updated without rebuilding")));
assert.ok(updatedIndex.some((doc: { slug: string; searchText: string }) => doc.slug === stored.slug && doc.searchText.includes("Updated without rebuilding")));
}
let home = "";
let purpose = "";
+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(