@uniweb/core 0.5.11 → 0.5.13

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/core",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -30,8 +30,8 @@
30
30
  "jest": "^29.7.0"
31
31
  },
32
32
  "dependencies": {
33
- "@uniweb/semantic-parser": "1.1.6",
34
- "@uniweb/theming": "0.1.1"
33
+ "@uniweb/semantic-parser": "1.1.7",
34
+ "@uniweb/theming": "0.1.2"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
package/src/page.js CHANGED
@@ -361,7 +361,12 @@ export default class Page {
361
361
  */
362
362
  getNavigableRoute() {
363
363
  if (this.hasContent()) return this.route
364
- for (const child of this.children || []) {
364
+ const children = this.children || []
365
+ // Prefer the index child (designated landing page for this folder)
366
+ const indexChild = children.find((c) => c.isIndex)
367
+ if (indexChild) return indexChild.getNavigableRoute()
368
+ // Fall back to first child with content
369
+ for (const child of children) {
365
370
  const route = child.getNavigableRoute()
366
371
  if (route) return route
367
372
  }
package/src/website.js CHANGED
@@ -900,7 +900,9 @@ export default class Website {
900
900
  // When nested, only include root-level pages at top level
901
901
  // (children will be nested inside their parents)
902
902
  if (nested) {
903
- filteredPages = filteredPages.filter(page => !page.parent)
903
+ // Exclude child pages from root list. Also exclude orphans whose parent
904
+ // was removed (e.g., hidden) — they have parentRoute but no resolved parent.
905
+ filteredPages = filteredPages.filter(page => !page.parent && !page.parentRoute)
904
906
  }
905
907
 
906
908
  // Apply custom sort or default to order