|
1 | 1 | # One Platform |
| 2 | + |
| 3 | +## 📝 Creating and Managing Content |
| 4 | + |
| 5 | +All content pages are located inside the `/content/pages/` directory. |
| 6 | +Each folder in this directory represents a **section**, and every section must contain an `index.md` |
| 7 | +(or `index.mdx`) file as the main entry for that topic. |
| 8 | + |
| 9 | +Astro automatically scans this folder structure and builds the navigation tree based on the files it finds — no |
| 10 | +manual configuration is required. |
| 11 | + |
| 12 | + |
| 13 | +### 📁 Folder structure example |
| 14 | + |
| 15 | +``` |
| 16 | + content/ |
| 17 | + └── pages/ |
| 18 | + ├── index.mdx → homepage (not shown in navigation) |
| 19 | + ├── products-and-services/ |
| 20 | + │ ├── index.md → “Products & Services” (main navigation item) |
| 21 | + │ ├── foundations/ |
| 22 | + │ │ └── index.md → child page under “Products & Services” |
| 23 | + │ └── components-and-patterns/ |
| 24 | + │ └── index.md → child page under “Products & Services” |
| 25 | + └── resources/ |
| 26 | + ├── documentation/ |
| 27 | + │ ├── index.md → “Documentation” (has subnavigation) |
| 28 | + │ ├── getting-started/ |
| 29 | + │ │ └── index.md → subpage |
| 30 | + │ └── foundations/ |
| 31 | + │ └── index.md → subpage |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +### 🧩 Frontmatter properties |
| 36 | + |
| 37 | +Each `index.md` (or `index.mdx`) file begins with a **frontmatter block**. That's the configuration area between `---` lines at the top of the file. |
| 38 | + |
| 39 | +Example: |
| 40 | + |
| 41 | +``` |
| 42 | +--- |
| 43 | +layout: "@template/layouts/default" |
| 44 | +title: "Foundations" |
| 45 | +order: 2 |
| 46 | +isSubNavigation: false |
| 47 | +hidePage: false |
| 48 | +iconTrailing: "arrow_right" |
| 49 | +--- |
| 50 | +``` |
| 51 | + |
| 52 | +Below is an explanation of each field: |
| 53 | + |
| 54 | +| Property | Type | Default | Description | |
| 55 | +| --------------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 56 | +| **`layout`** | `string` | required | Always use `@template/layouts/default` for standard pages. | |
| 57 | +| **`title`** | `string` | — | The name shown in the navigation and as the page headline. | |
| 58 | +| **`hidePage`** | `boolean` | `false` | If set to `true`, this page will **not** be directly visible in the navigation and users will be redirected to the first visible child page instead. Useful for sections that act as folders rather than actual pages. | |
| 59 | +| **`order`** | `number` | optional | Defines the order of this page among its siblings. Lower numbers appear first. | |
| 60 | +| **`isSubNavigation`** | `boolean` | `false` | When set to `true`, the page acts as a **parent with subpages**. On any of its child pages, a sub-navigation will automatically appear, highlighting the current child. | |
| 61 | +| **`iconTrailing`** | `string` | optional | Optional trailing icon displayed next to the navigation label (uses DB UX icon names). | |
| 62 | + |
| 63 | + |
| 64 | +### 🧭 How navigation is generated |
| 65 | + |
| 66 | +1. Main Navigation |
| 67 | + * Each top-level folder under `content/pages/` becomes a main navigation entry. |
| 68 | + * The order of these main items is determined by the `order` property in their respective `index.md` files. |
| 69 | + * The root homepage (`content/pages/index.mdx`) is automatically excluded. |
| 70 | + |
| 71 | +2. Subpages |
| 72 | + * Every subfolder inside a main section appears as a child item in the navigation. |
| 73 | + * Their `order` values define their position within the group. |
| 74 | + |
| 75 | +3. Sub-Navigation |
| 76 | + * If a parent page (like `Documentation`) has `isSubNavigation: true`, then on its child pages, a local sub-navigation bar will be shown. |
| 77 | + The current child page will appear highlighted in that bar. |
| 78 | + |
| 79 | +4. Hidden Pages |
| 80 | + * If `hidePage: true`, the page itself is not listed in the navigation. |
| 81 | + * When a user clicks the parent item, they will be taken directly to the first visible child page instead. |
| 82 | + |
| 83 | + |
| 84 | +### ✅ Best practices |
| 85 | + |
| 86 | +* Always include a title and layout in every page’s frontmatter. |
| 87 | +* Use `order` values like `1, 2, 3…` for clarity. |
| 88 | +* Avoid duplicate titles in the same folder level. |
| 89 | +* For “section overview” pages that should not have content themselves, set `hidePage: true` and place the actual content in child pages. |
| 90 | +* Only set `isSubNavigation: true` on parent pages that have multiple related subpages. |
0 commit comments