@bndynet/vue-site 1.0.2 → 1.0.4
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/README.md +6 -3
- package/bin/vue-site.mjs +4 -3
- package/dist/index.es.js +1680 -1582
- package/dist/router.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/presets.d.ts +7 -0
- package/dist/theme/resolve-palettes.d.ts +7 -1
- package/dist/types.d.ts +15 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -71,8 +71,9 @@ Add `"dev": "vue-site dev"` (or `vs dev`) in `package.json` scripts if you like.
|
|
|
71
71
|
|----------|-------------|
|
|
72
72
|
| `title` | Site title (sidebar + tab) |
|
|
73
73
|
| `nav` | `NavItem[]` |
|
|
74
|
+
| `defaultPath` | Path the site opens at; `/` and unknown paths redirect here. Must match a registered route (a `nav` item's resolved path or a `pages` entry's `path`). Defaults to the first top-level `nav` item |
|
|
74
75
|
| `logo` | Logo URL or imported image |
|
|
75
|
-
| `theme` | See `ThemeConfig` below |
|
|
76
|
+
| `theme` | See `ThemeConfig` below; set to `false` to disable theming (hides the switcher, forces a fixed `light` palette, no localStorage persistence) |
|
|
76
77
|
| `footer` | Footer text |
|
|
77
78
|
| `readme` | Raw Home content if no `README.md` |
|
|
78
79
|
| `links` | Header links: Lucide `icon` + `link`, optional `title` |
|
|
@@ -99,12 +100,14 @@ Add `"dev": "vue-site dev"` (or `vs dev`) in `package.json` scripts if you like.
|
|
|
99
100
|
|
|
100
101
|
### `ThemeConfig`
|
|
101
102
|
|
|
103
|
+
Built-in themes are `light`, `dark`, plus the always-on extras `sepia` and `ocean` (shown in the switcher for every site). Set `theme: false` on `SiteConfig` to disable theming entirely.
|
|
104
|
+
|
|
102
105
|
| Property | Default | Description |
|
|
103
106
|
|----------|---------|-------------|
|
|
104
|
-
| `default` | `light` | `light`, `dark`, or an `extraThemes[].id` |
|
|
107
|
+
| `default` | `light` | `light`, `dark`, a built-in extra id (`sepia`, `ocean`), or an `extraThemes[].id` |
|
|
105
108
|
| `colors` | — | Global CSS variable overrides |
|
|
106
109
|
| `palettes` | — | Partial overrides for built-in light/dark only |
|
|
107
|
-
| `extraThemes` | — | Extra themes: `id`, `label`, `icon`, optional `basedOn`, `palette`;
|
|
110
|
+
| `extraThemes` | — | Extra themes: `id`, `label`, `icon`, optional `basedOn`, `palette`; reuse a built-in id (`sepia`/`ocean`) to override it. Import `builtinThemePalettes` for full defaults |
|
|
108
111
|
|
|
109
112
|
## Per-page authorization (`auth`)
|
|
110
113
|
|
package/bin/vue-site.mjs
CHANGED
|
@@ -260,10 +260,11 @@ async function loadSiteConfig() {
|
|
|
260
260
|
const mod = await import(pathToFileURL(tmpFile).href)
|
|
261
261
|
return mod.default || {}
|
|
262
262
|
} catch (e) {
|
|
263
|
-
|
|
264
|
-
`[vue-site] Could not pre-load site config from ${foundConfig}: ${e.message}
|
|
263
|
+
throw new Error(
|
|
264
|
+
`[vue-site] Could not pre-load site config from ${foundConfig}: ${e.message}\n` +
|
|
265
|
+
` This usually means your config imports modules Node can't resolve directly ` +
|
|
266
|
+
`(path aliases like @/..., .vue/.css/asset imports, or framework APIs other than defineConfig).`,
|
|
265
267
|
)
|
|
266
|
-
return {}
|
|
267
268
|
} finally {
|
|
268
269
|
try {
|
|
269
270
|
fs.unlinkSync(tmpFile)
|