Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dev/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ export default defineConfig({
},
{
version: "v1",
route: {
version: {
v1: { label: "v1 (legacy)" },
},
},

title: "SolidBase v1 Demo",
themeConfig: {
sidebar: {
Expand Down
7 changes: 6 additions & 1 deletion docs/src/routes/guide/(2)config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,17 @@ overrides: [
{
project: "solidbase",
version: "v1",
route: {
version: {
v1: { label: "v1 (legacy)" },
},
},
},
],
// ..
```

Route override selectors use route axis names. Override config is applied over the base config, and `themeConfig` is shallow-merged with the base `themeConfig`.
Route override selectors use route axis names. Override config is applied over the base config, and `themeConfig` is merged with the base `themeConfig`. Use the `route` key to patch route axis value metadata for a matching route — for example, renaming a version's `label` only when browsing that version's routes. `path`, `href`, and `lang` cannot be changed.

#### Miscellaneous options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Version switcher for sites that configure `routes.version`.

- omitted when fewer than two version options are available
- uses Kobalte `Popover`
- applies `route` override patches from the resolved config to version labels
- displays each version option's `meta.label` when provided, otherwise the option name
- navigates to the selected version's route root
- scopes available versions to the current project
Expand Down
8 changes: 7 additions & 1 deletion docs/src/routes/reference/runtime-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ function useSolidBaseRoutes(): {
axis: string,
selection?: Partial<SolidBaseRouteSelection>,
): SolidBaseRouteOption[];
routeOverride: Accessor<SolidBaseRouteValueOverride>;
};

type SolidBaseRouteSelection = Record<string, string>;

type SolidBaseRouteValueOverride = Record<
string,
Record<string, SolidBaseRouteValueConfig>
>;

type SolidBaseRouteOption = {
name: string;
axis: string;
Expand All @@ -166,7 +172,7 @@ type SolidBaseRouteOption = {
};
```

`current()` returns the active route axis values for the current pathname. `path(...)` returns an internal route prefix for the provided partial selection merged over the current selection. `options(...)` returns valid options for an axis and filters internal values through `routes.include`.
`current()` returns the active route axis values for the current pathname. `path(...)` returns an internal route prefix for the provided partial selection merged over the current selection. `options(...)` returns valid options for an axis and filters internal values through `routes.include`. `routeOverride()` returns the merged `route` override patches for the current selection, applied to the `meta` of options.

### `useSolidBaseRoute`

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"solid-js": "^1.9.1",
"vite": "^8.0.0"
},
"packageManager": "pnpm@10.6.2+sha512.47870716bea1572b53df34ad8647b42962bc790ce2bf4562ba0f643237d7302a3d6a8ecef9e4bdfc01d23af1969aa90485d4cebb0b9638fa5ef1daef656f6c1b",
"packageManager": "pnpm@11.20.0",
"dependencies": {
"@alloc/quick-lru": "^5.2.0",
"@bprogress/core": "^1.3.4",
Expand All @@ -170,7 +170,7 @@
"@solid-primitives/media": "^2.3.5",
"@solid-primitives/platform": "^0.1.2",
"@solid-primitives/scroll": "^2.1.5",
"@solid-primitives/storage": "^4.3.4",
"@solid-primitives/storage": "^4.4.0",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.3",
"cross-spawn": "^7.0.6",
Expand Down
Loading
Loading