uniweb 0.2.38 → 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 +4 -4
- package/partials/adding-pages.hbs +54 -6
- package/partials/claude-md.hbs +27 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.2.
|
|
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.
|
|
41
|
-
"@uniweb/
|
|
40
|
+
"@uniweb/build": "0.1.21",
|
|
41
|
+
"@uniweb/core": "0.1.9",
|
|
42
42
|
"@uniweb/kit": "0.1.5",
|
|
43
|
-
"@uniweb/
|
|
43
|
+
"@uniweb/runtime": "0.2.11"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
### Section Ordering
|
|
11
11
|
|
|
12
|
-
By default, sections are discovered from `.md` files and sorted by numeric prefix (`1-`, `2-`, `
|
|
12
|
+
By default, sections are discovered from `.md` files and sorted by numeric prefix (`1-`, `2-`, `3-`).
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
**Decimal prefixes** allow inserting sections without renumbering: `2.5-` sorts between `2-` and `3-`.
|
|
15
|
+
|
|
16
|
+
For explicit control, use the `sections` property in `page.yml`:
|
|
15
17
|
|
|
16
18
|
```yaml
|
|
17
19
|
title: My Page
|
|
@@ -21,9 +23,55 @@ sections:
|
|
|
21
23
|
- pricing
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
This
|
|
26
|
+
This makes reordering easy (move lines) and allows commenting out sections temporarily.
|
|
25
27
|
|
|
26
28
|
**Options:**
|
|
27
|
-
- `sections: *` or omit — auto-discover and sort `.md` files (default)
|
|
28
|
-
- `sections: [hero, features]` — explicit ordering, no
|
|
29
|
-
- `sections: []`
|
|
29
|
+
- `sections: *` or omit — auto-discover and sort `.md` files by prefix (default)
|
|
30
|
+
- `sections: [hero, features]` — explicit ordering, no prefixes needed
|
|
31
|
+
- `sections: []` — pure route with no content sections
|
|
32
|
+
|
|
33
|
+
### Section Hierarchy (Subsections)
|
|
34
|
+
|
|
35
|
+
For parent-child relationships, use the explicit array with nesting:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
sections:
|
|
39
|
+
- hero
|
|
40
|
+
- features:
|
|
41
|
+
- logocloud
|
|
42
|
+
- stats
|
|
43
|
+
- pricing
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This is clearer than prefix notation and easier to restructure.
|
|
47
|
+
|
|
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`
|
package/partials/claude-md.hbs
CHANGED
|
@@ -122,11 +122,36 @@ sections:
|
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
**Section ordering:**
|
|
125
|
-
- Default: `.md` files discovered and sorted by numeric prefix (`1-`, `2-`, `
|
|
125
|
+
- Default: `.md` files discovered and sorted by numeric prefix (`1-`, `2-`, `3-`)
|
|
126
|
+
- Decimals to insert: `2.5-` sorts between `2-` and `3-` (no renumbering needed)
|
|
126
127
|
- Explicit: Use `sections: [hero, features]` — no prefixes needed, easy reordering
|
|
127
|
-
- Empty: `sections: []`
|
|
128
|
+
- Empty: `sections: []` — pure route with no content
|
|
128
129
|
- Wildcard: `sections: *` — explicitly use default behavior
|
|
129
130
|
|
|
131
|
+
**Section hierarchy:** For subsections, use explicit nesting in `page.yml`:
|
|
132
|
+
```yaml
|
|
133
|
+
sections:
|
|
134
|
+
- hero
|
|
135
|
+
- features:
|
|
136
|
+
- logocloud
|
|
137
|
+
- stats
|
|
138
|
+
```
|
|
139
|
+
This is clearer than prefix notation (`1,1-`, `1,2-`) and easier to restructure.
|
|
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
|
+
|
|
130
155
|
## Component Development
|
|
131
156
|
|
|
132
157
|
### Props Interface
|