Skip to content

fix(playground): /themes leads to the theme index - #189

Merged
ajianaz merged 1 commit into
developfrom
fix/188-themes-index
Nov 15, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/188-themes-index

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

/themes sends the visitor to the theme index instead of answering 404 (#188). Closes #188.

  • apps/playground/src/routes/themes/+page.ts redirects to the "Theme pages" section on /tokens (#index-title), the index that the nav and the theme pages' breadcrumb already point at. I did not add a second index page.
  • Prerendering. The page has trailingSlash = 'always', so it is built as themes/index.html with a meta refresh and a script, both using the relative URL ../tokens#index-title. This needs no server and no JavaScript. GitHub Pages answers /themes with /themes/, so the relative URL resolves correctly. Without the trailing slash, the redirect would be built as themes.html beside the themes/ folder, and a folder redirect would make its URL miss the target.
  • Smoke test. The Pages smoke test (pages.yml) now also checks that /themes leads to the index.

Why

Every /themes/<name> page exists, but the folder URL was a dead end on GitHub Pages and locally. That happens when a visitor trims the URL or follows a link to the folder.

Testing

  • Local gates: bun run check, test, lint and detect pass. This is the playground only, so there is no changeset.
  • GitHub Pages-like server (folder → slash redirect, then .html, then index.html), checked in Chromium:
    • /codecora-ui/themes ends on /codecora-ui/tokens#index-title with the "Theme pages" heading;
    • so does /codecora-ui/themes/;
    • so does client-side navigation from /themes/corin.
  • The pages.yml smoke steps, run locally with vite preview:
    • the 8 listed paths are served;
    • /themes answers 308 to /themes/, then reaches the meta refresh;
    • an unknown page still answers 404.
  • Cora review on the staged diff (severity major): deterministic checks found nothing; the agent judge returned should_block: false, 0 issues.

/themes answered 404 although every /themes/<name> page exists. It now
redirects to the "Theme pages" index on /tokens, where the nav and the
theme pages' breadcrumb already point. Prerendered as themes/index.html
with a meta refresh, it works on GitHub Pages without a server or
JavaScript, and the Pages smoke test checks it.

Closes #188
@ajianaz
ajianaz merged commit 3c584a2 into develop Nov 15, 2026
16 of 18 checks passed
@ajianaz
ajianaz deleted the fix/188-themes-index branch November 15, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(playground): /themes leads to the theme index

1 participant