fimo 2.6.0-staging.4 → 2.7.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/fimo-cli/references/locales.md +2 -2
- package/assets/skills/fimo-cli/references/pages.md +14 -2
- package/assets/skills/fimo-code/references/frameworks/astro.md +2 -0
- package/dist/cli/bundle.json +2 -2
- package/dist/cli/index.js +7 -7
- package/dist/runtime/paths/get-fimo-paths.d.ts +3 -1
- package/dist/runtime/paths/get-fimo-paths.js +59 -5
- package/dist/runtime/routes/index.d.ts +19 -3
- package/dist/runtime/routes/index.js +27 -2
- package/dist/scripts/validate-page-registry.js +14 -3
- package/package.json +8 -8
- package/templates/astro/package.json +2 -2
- package/templates/nextjs/package.json +3 -3
- package/templates/react-router/package.json +4 -4
- package/templates/sveltekit/package.json +2 -2
- package/templates/vite/package.json +4 -4
|
@@ -90,7 +90,7 @@ Write the locale into a route's path with the reserved `:locale` segment, never
|
|
|
90
90
|
| `/:locale/blog/:slug` | `{ "type": "locale", "optional": false }` | `/en/blog/hello` and `/fr/blog/bonjour` |
|
|
91
91
|
| `/:locale/pricing` | omitted | `/pricing` for `en`, `/fr/pricing` for `fr` |
|
|
92
92
|
|
|
93
|
-
- `locale` is reserved. It is read from the URL, so it never takes `schema` or `queryField` and never becomes a CMS query. Every other param is
|
|
93
|
+
- `locale` is reserved. It is read from the URL, so it never takes `schema` or `queryField` and never becomes a CMS query. Every other param is an `entry` param that needs both, unless it declares `"type": "external"`: an external param takes no other keys, and the application owns its values.
|
|
94
94
|
- `optional: true` means omit the configured default locale from the URL. With `i18n.defaultLocale: "en"`, `/pricing` is English and `/fr/pricing` is French.
|
|
95
95
|
- `optional: false` prefixes every locale, including the default (`/en/pricing` and `/fr/pricing`). Changing `i18n.defaultLocale` chooses the fallback locale; it does not by itself change this prefix policy.
|
|
96
96
|
- A route with no `:locale` segment stays application-owned. Studio shows it once and neither adds nor interprets a locale segment.
|
|
@@ -102,7 +102,7 @@ Register the same shape in the router. React Router spells the omittable segment
|
|
|
102
102
|
route(':locale?/blog/:slug', './pages/BlogPost.tsx');
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
These canonical entries are also the optional metadata used by Studio Pages. See `references/pages.md` for
|
|
105
|
+
These canonical entries are also the optional metadata used by Studio Pages. See `references/pages.md` for the three `params` types and declared `sources`.
|
|
106
106
|
|
|
107
107
|
For every framework, the application owns its URL scheme, resolves the locale, and passes it into Fimo. Studio stores the locale the app reports for the current location — including when only the locale changed — and reads content in it. Route metadata is optional unless the project wants Fimo Studio route selection/navigation.
|
|
108
108
|
|
|
@@ -7,15 +7,27 @@ Pages can mirror the application's routes in Fimo Studio. It gives editors a rou
|
|
|
7
7
|
A route has three separate parts:
|
|
8
8
|
|
|
9
9
|
- `path` is the URL pattern, such as `/blog/:slug`.
|
|
10
|
-
- `params` optionally
|
|
10
|
+
- `params` optionally describes each path placeholder: an entry bound to a Collection so Studio can select a concrete route in the page header, the reserved `locale` segment, or a value the application owns.
|
|
11
11
|
- `sources` optionally names the Labels, Single, and Collection results editors manage after selecting a route.
|
|
12
12
|
|
|
13
|
-
Each param key matches a `:placeholder` in `path`. `schema` selects the Collection, `queryField` is the entry field stored in the URL, and `displayField` is the field Studio shows to editors. Use `id` or the built-in `slug` for `queryField`; a custom URL field must set both `"required": true` and `"unique": true` in its schema. Params resolve in path order, so a later param query may use an earlier selection:
|
|
13
|
+
Each param key matches a `:placeholder` in `path`. For an entry param, `schema` selects the Collection, `queryField` is the entry field stored in the URL, and `displayField` is the field Studio shows to editors. Use `id` or the built-in `slug` for `queryField`; a custom URL field must set both `"required": true` and `"unique": true` in its schema. Params resolve in path order, so a later param query may use an earlier selection:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
fimo pages set <id> --path '/shop/:category/:product' --params '{"category":{"schema":"Category","queryField":"slug","displayField":"name"},"product":{"schema":"Product","queryField":"slug","displayField":"name","query":{"where":{"category":"$params.category.id"},"sort":"name"}}}'
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
A descriptor's `type` is optional and selects one of three param kinds:
|
|
20
|
+
|
|
21
|
+
- `entry` (the default) binds the placeholder to a Collection with `schema`, `queryField`, `displayField`, and an optional `query`.
|
|
22
|
+
- `locale` is the reserved `:locale` segment with an optional `optional` boolean. See `references/locales.md`.
|
|
23
|
+
- `external` takes no other keys. The application owns the values: Fimo matches the segment from the URL and never looks it up in the CMS.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
fimo pages set <id> --path '/cartes/:slug' --params '{"slug":{"type":"external"}}'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Declare a placeholder `external` when its values are not Fimo content — a catalogue synced from an upstream source and stored as a media asset, ids that exist only in the visitor's browser, computed archive or pagination segments, third-party ids. Never bind a placeholder to an unrelated Collection to make `fimo validate` pass. `fimo pages list` reports `dynamic:external` and `fimo pages list --expand` skips the route; `fimo/paths` and the generated sitemap emit nothing for it, so the application enumerates those URLs itself. A `$params.<name>.<field>` expression in a param query or a source may reference entry params only. A route may mix kinds: entry params keep their selectors in Studio, and an external param takes a typed value in the preview header.
|
|
30
|
+
|
|
19
31
|
`sources` is a named object under `routes.<id>.sources`. It is not an array or a route definition. Keep its keys stable and descriptive:
|
|
20
32
|
|
|
21
33
|
```json
|
|
@@ -170,6 +170,8 @@ The new-project shell pairs unprefixed default-locale pages with a parallel `[lo
|
|
|
170
170
|
}
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
A dynamic segment whose values are not Fimo content takes `{ "type": "external" }` instead of a Collection binding; Fimo matches it from the URL, and the page's own `getStaticPaths` (or on-demand rendering) supplies those values.
|
|
174
|
+
|
|
173
175
|
## Client islands
|
|
174
176
|
|
|
175
177
|
Generated content reads remain server-only. Preserve existing islands and do not add React or a client SDK to work around this boundary.
|
package/dist/cli/bundle.json
CHANGED