feat: enable companion suite prerendering by card ID#2852
Merged
sydseter merged 4 commits intoOWASP:masterfrom Apr 24, 2026
Merged
feat: enable companion suite prerendering by card ID#2852sydseter merged 4 commits intoOWASP:masterfrom
sydseter merged 4 commits intoOWASP:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables direct browsing and prerendering of Companion edition cards via standard /cards/{cardId} routes (e.g. /cards/LLMA), matching behavior of other editions and avoiding prerender failures.
Changes:
- Added Companion card routes (
LLM,CLD,FRE,DVO,BOT,AAI) to SvelteKit prerenderentries. - Updated
/cards/[card]server load to include Companion deck cards in the lookup map so prerendering doesn’t crash with “Card not found”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cornucopia.owasp.org/svelte.config.js |
Adds /cards/* prerender entries for all Companion card IDs so static builds generate the expected pages. |
cornucopia.owasp.org/src/routes/cards/[card]/+page.server.ts |
Loads Companion cards alongside existing decks so /cards/{id} resolves for Companion card IDs during prerender/runtime. |
Contributor
Author
|
Hello @sydseter , have a look at this whenever you have time. |
sydseter
approved these changes
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, the Companion edition was only browsable by reaching its explicit endpoint (e.g.,
/edition/companion/LLM2/1.0/en). This PR enables users to reach all companion cards directly by requesting their card ID (e.g.,/cards/LLMA,/cards/LLM2, etc.), aligning the companion suite with the project's standard card routing behavior.Fixes: #2850
Changes Made:
LLM,CLD,FRE,DVO,BOT,AAI) in theentriesarray insvelte.config.jsto ensure they are successfully pre-rendered by SvelteKit duringnpm run productionbuild.src/routes/cards/[card]/+page.server.tsto fetch and loadcompanionCardsinto the central tracking map alongsidemobileCardsandwebappCards. This fixes the "Card not found" prerender crash that occurs when the router attempts to map the newly added cards.Testing:
Successfully ran
npm run productionbuildand confirmed thebuild/cardsdirectory reliably compiles and serves allindex.htmlartifacts for every companion card.AI Usage:
Used AI assistance to identify and fix the missing prerendering routes and backend card loading issue. Code changes were verified manually with a local production build.