The routing system in this playground is fully automatic. Categories, breadcrumbs, and sketch routes are all derived at runtime fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hetari/creative-coding/llms.txt
Use this file to discover all available pages before exploring further.
src/config/sketches.ts β you never create route files or category index pages by hand. The entire src/pages/ directory contains exactly two files: index.vue (the root dashboard renderer) and [...all].vue (the catch-all router seam that handles every other path).
How Categories Work
Every sketch has acategory field. Single-segment values like 'shader' place the sketch directly under a top-level category. Multi-segment values like 'gsap/footer' create an intermediate sub-category level automatically. The buildDashboardItems() utility reads the current URL path and computes which cards to show at each depth β no static category configuration exists anywhere else.
Using the real entries from src/config/sketches.ts, the full dashboard hierarchy looks like this:
The Catch-All Router Seam
src/pages/[...all].vue is a single Vue component that handles every URL not matched by index.vue. When a navigation occurs, the component checks the path against the registry and chooses one of three rendering branches:
Leaf Sketch
getSketchByPath(route.path) returns a match β dynamically imports the sketch component factory and renders the result. Shows a loading spinner during the async import and an error state if the import fails.Category Dashboard
isCategoryPath(route.path) returns true β renders <IndexPage /> (the same root dashboard component) with the current path as context, causing buildDashboardItems() to return the filtered child list for that depth.404 Fallback
Neither condition matches β renders a styled 404 page with a βReturn to Playgroundβ link. This occurs when a path exists in neither the SKETCHES registry nor as a valid category prefix.
src/config/sketches.ts:
URL Slug Formatting
TheslugToLabel() function from src/utils/slug.ts converts raw URL path segments into human-readable display labels used in card headers and the dashboard page title. It handles two transformations:
- Strips numeric sort prefixes β a leading
digits-prefix is removed so filesystem ordering conventions never leak into the UI (000-learnβlearn). - Title-cases the result β hyphens and underscores become spaces, and each word is capitalized (
my-sketchβMy Sketch).
| Slug | Label |
|---|---|
000-learn | Learn |
010-webgl-earth | Webgl Earth |
ascii-hand | Ascii Hand |
reveal-loader | Reveal Loader |
shaders | Shaders |
The buildDashboardItems() Utility
buildDashboardItems() in src/utils/dashboard.ts is the function that builds the card list rendered on each dashboard page. Its signature is:
SKETCHES array for each call and applies the following logic:
- Compute current depth β split
currentPathinto segments and measure depth (root/= 0,/gsap= 1,/gsap/footer= 2). - Filter by prefix β keep only sketches whose URL path starts with
currentPath. - Group by next segment β collect all sketches that share the same path segment at
depth + 1(the immediate children). - Classify each child:
- If any sketch in the group has path segments beyond depth + 1, the child is a category folder card (
isCategory: true, iconπ). - If the group contains exactly one sketch at depth + 1, the child is a leaf sketch card (
isCategory: false, iconβ¦).
- If any sketch in the group has path segments beyond depth + 1, the child is a category folder card (
- Sort by
orderβ the returned array is sorted ascending by theminOrderof each group.
DashboardItem[] array is consumed directly by index.vue to render the card grid.