Repository navigation
feat(guides): merge every product repo's guides into the Guides tab - #131
Conversation
|
🚅 Deployed to the website-pr-131 environment in rivet-website
|
7240a07 to
3d6b55d
Compare
| for (const entry of await getCollection('docs')) { | ||
| // The glob loader collapses `learn/index.mdx` to the id `actors/learn`; | ||
| // that page is replaced by the website-owned overview below. | ||
| if (entry.id === ACTORS_LEARN_CONTENT_PREFIX) continue; | ||
| if (!entry.id.startsWith(learnPrefix)) continue; | ||
| const slug = entry.id.slice(learnPrefix.length); | ||
| descriptions[guideHref(slug)] = entry.data.description; | ||
| paths.push({ | ||
| params: { slug: getContentParamSlug(slug) }, | ||
| props: { | ||
| entry, | ||
| editUrlOverride: `https://github.com/rivet-dev/rivet/edit/main/docs/actors/content/learn/${slug}.mdx`, | ||
| }, | ||
| }); | ||
| } | ||
|
|
||
| for (const guide of SITE_GUIDES) { | ||
| const entry = siteGuides.get(guide.slug); | ||
| if (!entry) { | ||
| const guide = guideForContentId(entry.id); |
There was a problem hiding this comment.
🔴 High · The new loader drops every guide before the vendor sync exists
This head deletes the four website-owned guides and stops reading actors/learn, but the committed Actors bundle still contains only content/learn/ and a "learn" sidebar—there is no content/guides/ or "guides" key for this loop to discover. As a result /guides/ contains only the overview and all existing guide URLs disappear (and the build check is currently failing). Land the Actors repository change through its bot-generated docs-sync/* PR and rebase it into this head before switching the loader/deleting the old sources, or retain a compatibility fallback until that sync is present.
Each product bundle may ship content/guides/<slug>.mdx and a "guides" key in its sidebar.json, linked as /guides/<slug>. The Guides tab lists every bundle's groups in product order and merges groups with the same title, and guides keep resolving <CodeSnippet> paths against their own repo. - src/sitemap/guides.ts: GUIDE_BUNDLES and content-id helpers replace the Actors-only learn prefix and SITE_GUIDES. - guidesSidebar(): website Overview group, then merged bundle groups. - check-sitemap: sidebar and content agree per bundle, and a slug defined by two bundles fails the build. The route also throws on a duplicate. - The four website-owned guides moved to rivet-dev/rivet's Actors bundle. vendor/actors carries that change (rivet-dev/rivet#5853) so this PR is self-consistent. /actors/learn/* still redirects to /guides/*. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-d43d6059-e31e-4220-91d1-5e00ec65c552
3d6b55d to
6a2a4bb
Compare
Until now the Guides tab only read the Actors bundle's
learnsection plus four website-owned guides. Any product repo can now ship guides, and they keep their own examples.Convention
Bundles link guides as
/guides/<slug>, so nothing is re-rooted.<CodeSnippet>paths already resolve against the repo that owns the MDX file, so an Agents guide embedsrivet-dev/agentsexamples, and its edit and source links point there.Sidebar merge
The sidebar starts with the website's Overview group. Then come every bundle's
guidesgroups, inPRODUCTSorder. Groups with the same title merge at the position where the title first appears, keeping each bundle's page order. With rivet-dev/rivet#5853 and rivet-dev/agents#348, the result is: General, Guides, Solutions, Architecture (Actors), then Agents (Sign in with ChatGPT).Changes
src/sitemap/guides.ts:GUIDE_BUNDLESand content-id helpers replaceACTORS_LEARN_CONTENT_PREFIX,rerootLearnHref, andSITE_GUIDES.src/sitemap/products.ts:guidesSidebar()merges the groups. The raw sidebar JSON is cast throughunknown, because icons are still names before hydration.src/pages/guides/[...slug].astro: routes<bundle>/guides/*, builds edit URLs from the owning repo, and throws when two bundles define the same slug.src/metadata/*: a bundle's ownguides/index.mdxnever publishes, and theSITE_GUIDESloop is removed.scripts/check-sitemap.ts: the sidebar and content directories must agree per bundle, and duplicate slugs fail the check.redirects.mjs:/actors/learn/*redirects read the renamed folder.vendor/actorscarries docs(actors): rename the learn section to guides and move the website's Actors guides in rivet#5853 exactly, so this PR builds on its own.CLAUDE.md,HIDDEN.md, andDARK_MODE_ASSETS.md.Verified locally
pnpm check:sitemappasses. Adding a duplicatechat-roomguide to the agents bundle fails it with/guides/chat-room/ is defined by more than one bundle: actors, agents.pnpm build(642 pages) andpnpm check:seopass./guides/lists 13 cards,/guides/sign-in-with-chatgpt/renders agents snippets, and/actors/learn/chat-roomreturns 301 to/guides/chat-room/.tscreports no errors in the changed files (188 pre-existing errors elsewhere, down from 190).Merge order
/guides/sign-in-with-chatgpt.