uniweb 0.6.20 → 0.6.21
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 +2 -2
- package/partials/agents-md.hbs +6 -3
- package/src/commands/i18n.js +10 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.21",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"js-yaml": "^4.1.0",
|
|
41
41
|
"prompts": "^2.4.2",
|
|
42
42
|
"tar": "^7.0.0",
|
|
43
|
+
"@uniweb/build": "0.6.18",
|
|
43
44
|
"@uniweb/core": "0.4.7",
|
|
44
45
|
"@uniweb/kit": "0.5.10",
|
|
45
|
-
"@uniweb/build": "0.6.17",
|
|
46
46
|
"@uniweb/runtime": "0.5.21"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/partials/agents-md.hbs
CHANGED
|
@@ -167,16 +167,19 @@ Decimals insert between: `2.5-testimonials.md` goes between `2-` and `3-`.
|
|
|
167
167
|
```yaml
|
|
168
168
|
title: About Us
|
|
169
169
|
description: Learn about our company
|
|
170
|
-
order: 2 # Navigation sort
|
|
170
|
+
order: 2 # Navigation sort position
|
|
171
|
+
pages: [team, history, ...] # Child page order (... = rest). Without ... = strict (hides unlisted)
|
|
171
172
|
index: getting-started # Which child page is the index
|
|
172
173
|
```
|
|
173
174
|
|
|
174
175
|
**site.yml:**
|
|
175
176
|
```yaml
|
|
176
|
-
index: home
|
|
177
|
+
index: home # Just set the homepage
|
|
178
|
+
pages: [home, about, ...] # Order pages (... = rest, first = homepage)
|
|
179
|
+
pages: [home, about] # Strict: only listed pages in nav
|
|
177
180
|
```
|
|
178
181
|
|
|
179
|
-
Use `
|
|
182
|
+
Use `pages:` with `...` for ordering, without `...` for strict visibility control. Use `index:` for simple homepage selection.
|
|
180
183
|
|
|
181
184
|
## Semantic Theming
|
|
182
185
|
|
package/src/commands/i18n.js
CHANGED
|
@@ -237,24 +237,20 @@ async function runExtract(siteRoot, config, args) {
|
|
|
237
237
|
if (!collectionsOnly) {
|
|
238
238
|
log(`\n${colors.cyan}Extracting translatable content${dryRun ? ' (dry run)' : ''}...${colors.reset}\n`)
|
|
239
239
|
|
|
240
|
-
// Check if site has been built
|
|
241
|
-
const siteContentPath = join(siteRoot, 'dist', 'site-content.json')
|
|
242
|
-
if (!existsSync(siteContentPath)) {
|
|
243
|
-
error('Site content not found. Run "uniweb build" first.')
|
|
244
|
-
process.exit(1)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
240
|
try {
|
|
248
|
-
//
|
|
241
|
+
// Collect site content directly from source files (no build required)
|
|
242
|
+
const { collectSiteContent } = await import('@uniweb/build/site')
|
|
249
243
|
const { extractManifest, formatSyncReport } = await import('@uniweb/build/i18n')
|
|
250
244
|
|
|
245
|
+
log(`${colors.dim}Collecting site content...${colors.reset}`)
|
|
246
|
+
const siteContent = await collectSiteContent(siteRoot)
|
|
247
|
+
|
|
251
248
|
// Check if this is a first-time extract (no previous manifest)
|
|
252
249
|
const manifestPath = join(siteRoot, config.localesDir, 'manifest.json')
|
|
253
250
|
const isUpdate = existsSync(manifestPath)
|
|
254
251
|
|
|
255
|
-
const { manifest, report } = await extractManifest(siteRoot, {
|
|
252
|
+
const { manifest, report } = await extractManifest(siteRoot, siteContent, {
|
|
256
253
|
localesDir: config.localesDir,
|
|
257
|
-
siteContentPath,
|
|
258
254
|
verbose,
|
|
259
255
|
dryRun,
|
|
260
256
|
})
|
|
@@ -1466,11 +1462,10 @@ ${colors.bright}Configuration:${colors.reset}
|
|
|
1466
1462
|
By default, all *.json files in locales/ are treated as translation targets.
|
|
1467
1463
|
|
|
1468
1464
|
${colors.bright}Workflow:${colors.reset}
|
|
1469
|
-
1.
|
|
1470
|
-
2.
|
|
1471
|
-
3.
|
|
1472
|
-
4.
|
|
1473
|
-
5. Build with translations: uniweb build (generates locale-specific output)
|
|
1465
|
+
1. Extract strings: uniweb i18n extract
|
|
1466
|
+
2. Generate locale files: uniweb i18n generate es fr
|
|
1467
|
+
3. Translate locale files: Edit locales/es.json, locales/fr.json, etc.
|
|
1468
|
+
4. Build with translations: uniweb build (generates locale-specific output)
|
|
1474
1469
|
|
|
1475
1470
|
${colors.bright}File Structure:${colors.reset}
|
|
1476
1471
|
locales/
|