uniweb 0.2.39 → 0.2.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.2.39",
3
+ "version": "0.2.40",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,9 +37,9 @@
37
37
  "js-yaml": "^4.1.0",
38
38
  "prompts": "^2.4.2",
39
39
  "tar": "^7.0.0",
40
- "@uniweb/build": "0.1.20",
40
+ "@uniweb/build": "0.1.21",
41
+ "@uniweb/core": "0.1.9",
41
42
  "@uniweb/kit": "0.1.5",
42
- "@uniweb/runtime": "0.2.11",
43
- "@uniweb/core": "0.1.8"
43
+ "@uniweb/runtime": "0.2.11"
44
44
  }
45
45
  }
@@ -46,3 +46,32 @@ sections:
46
46
  This is clearer than prefix notation and easier to restructure.
47
47
 
48
48
  **Advanced:** Comma prefixes (`1,1-`, `1,2-`) also denote hierarchy, but explicit arrays are recommended for readability.
49
+
50
+ ### Page Ordering and Index Pages
51
+
52
+ Parent controls which page is the "index" for its route. The index page gets the parent's route.
53
+
54
+ **In `site.yml`** (for top-level pages):
55
+ ```yaml
56
+ name: My Site
57
+ pages: [home, about, features] # First (home) is homepage at /
58
+ # Or just name the homepage:
59
+ index: home
60
+ ```
61
+
62
+ **In `page.yml`** (for child pages):
63
+ ```yaml
64
+ title: Documentation
65
+ pages: [getting-started, installation, config] # First is index for /docs
66
+ # Or just name the index:
67
+ index: getting-started
68
+ ```
69
+
70
+ **How it works:**
71
+ - `pages: [a, b, c]` — Explicit order, first item gets parent route
72
+ - `index: name` — Just set the index, auto-discover the rest
73
+ - Omit both — Sort by `order` prop, lowest becomes index
74
+
75
+ **Example:** If `getting-started` is the index for `/docs`:
76
+ - `pages/docs/getting-started/` → route `/docs`
77
+ - `pages/docs/installation/` → route `/docs/installation`
@@ -138,6 +138,20 @@ sections:
138
138
  ```
139
139
  This is clearer than prefix notation (`1,1-`, `1,2-`) and easier to restructure.
140
140
 
141
+ **Page ordering:** Parent controls which page is the index for its route:
142
+ ```yaml
143
+ # In site.yml (top-level pages)
144
+ pages: [home, about, docs] # First is homepage at /
145
+ index: home # Or just name the homepage
146
+
147
+ # In page.yml (child pages)
148
+ pages: [getting-started, installation] # First is index for this route
149
+ index: getting-started # Or just name the index
150
+ ```
151
+ - `pages: [a, b, c]` — First gets parent route (becomes index)
152
+ - `index: name` — Just set index, auto-discover rest
153
+ - Omit both — Sort by `order` prop, lowest becomes index
154
+
141
155
  ## Component Development
142
156
 
143
157
  ### Props Interface