@koehler8/cms 1.0.0-beta.22 → 1.0.0-beta.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vite-plugin.js +12 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koehler8/cms",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.23",
4
4
  "description": "Vertex CMS — lightweight, config-driven Vue 3 framework with theming, extensions, and SSG support",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/vite-plugin.js CHANGED
@@ -466,16 +466,23 @@ export default function cmsPlugin(options = {}) {
466
466
  if (!siteConfig) {
467
467
  throw new Error(`[@koehler8/cms] site config not found at ${configDir}`);
468
468
  }
469
- // Discover locales actually present on disk: directories under
470
- // content/ that contain a site.json. This becomes the authoritative
471
- // list for both the SSG route fanout and the runtime locale-aware
472
- // canonical/hreflang emission.
469
+ // Discover locales actually present on disk: any directory under
470
+ // content/ that has at least one of `site.json`, `shared.json`, or
471
+ // a `pages/` subdir is treated as a real locale. (Earlier the check
472
+ // required `site.json` specifically — too strict for sites that
473
+ // author per-locale page overrides without overriding the site
474
+ // metadata, which is the common pattern for translation-only locale
475
+ // dirs.)
476
+ const localeDirHasContent = (dir) =>
477
+ fs.existsSync(path.join(dir, 'site.json'))
478
+ || fs.existsSync(path.join(dir, 'shared.json'))
479
+ || fs.existsSync(path.join(dir, 'pages'));
473
480
  availableLocales = fs.existsSync(contentDir)
474
481
  ? fs
475
482
  .readdirSync(contentDir, { withFileTypes: true })
476
483
  .filter((d) => d.isDirectory())
477
484
  .map((d) => d.name)
478
- .filter((name) => fs.existsSync(path.join(contentDir, name, 'site.json')))
485
+ .filter((name) => localeDirHasContent(path.join(contentDir, name)))
479
486
  .sort()
480
487
  : [];
481
488
  pagePaths = collectPagePaths(siteConfig);