|
| 1 | +# Layout Types |
| 2 | + |
| 3 | +The Nimiq VitePress theme provides three distinct layout types to accommodate different content needs and use cases. Each layout offers a unique combination of navigation elements, content structure, and styling approach. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +| Layout | Use Case | Sidebar | Secondary Sidebar | Breadcrumbs | Container | Static Content CSS | |
| 8 | +| ------------ | ------------------- | ------- | ----------------- | ----------- | ------------- | ------------------ | |
| 9 | +| **docs** | Documentation pages | ✅ | ✅ | ✅ | ✅ Padded | ❌ | |
| 10 | +| **home** | Landing pages | ❌ | ❌ | ❌ | ❌ | ❌ | |
| 11 | +| **overview** | Module entry pages | ✅ | ❌ | ❌ | ❌ Full-width | ✅ | |
| 12 | + |
| 13 | +## Documentation Layout (Default) |
| 14 | + |
| 15 | +The standard layout for documentation pages with full navigation features and optimized reading experience. |
| 16 | + |
| 17 | +### Features |
| 18 | + |
| 19 | +- **Primary sidebar** with navigation menu |
| 20 | +- **Secondary sidebar** with table of contents and widgets |
| 21 | +- **Breadcrumbs** navigation at the top |
| 22 | +- **Page actions** (Copy MD, View Source buttons) |
| 23 | +- **Container padding** for optimal reading width |
| 24 | +- **Responsive design** with mobile navigation |
| 25 | + |
| 26 | +### Usage |
| 27 | + |
| 28 | +```yaml |
| 29 | +--- |
| 30 | +# Default layout - no layout specified |
| 31 | +title: Documentation Page |
| 32 | +--- |
| 33 | + |
| 34 | +# Your Documentation Content |
| 35 | + |
| 36 | +This will render with the full documentation layout including sidebars, breadcrumbs, and page actions. |
| 37 | +``` |
| 38 | + |
| 39 | +### Best For |
| 40 | + |
| 41 | +- API documentation |
| 42 | +- Guides and tutorials |
| 43 | +- Reference materials |
| 44 | +- Technical documentation |
| 45 | + |
| 46 | +## Home Layout |
| 47 | + |
| 48 | +A clean, minimal layout designed for landing pages and home screens. |
| 49 | + |
| 50 | +### Features |
| 51 | + |
| 52 | +- **No sidebars** for clean presentation |
| 53 | +- **Desktop header** with navigation |
| 54 | +- **No breadcrumbs** or page actions |
| 55 | +- **Mobile navigation** at the bottom |
| 56 | +- **Full creative control** over layout |
| 57 | + |
| 58 | +### Usage |
| 59 | + |
| 60 | +```yaml |
| 61 | +--- |
| 62 | +layout: home |
| 63 | +title: Welcome to Our Documentation |
| 64 | +--- |
| 65 | + |
| 66 | +# Welcome |
| 67 | + |
| 68 | +Landing page content with full design freedom. |
| 69 | +``` |
| 70 | + |
| 71 | +### Best For |
| 72 | + |
| 73 | +- Project landing pages |
| 74 | +- Welcome screens |
| 75 | +- Marketing content |
| 76 | +- Overview dashboards |
| 77 | + |
| 78 | +## Overview Layout |
| 79 | + |
| 80 | +Perfect for module entry pages that need navigation but maximum content flexibility. |
| 81 | + |
| 82 | +### Features |
| 83 | + |
| 84 | +- **Primary sidebar** for navigation context |
| 85 | +- **No secondary sidebar** for clean content area |
| 86 | +- **No breadcrumbs** or page actions for minimal UI |
| 87 | +- **Full-width content** without container constraints |
| 88 | +- **Static content CSS** for enhanced typography and sections |
| 89 | +- **Mobile navigation** with outline accordion |
| 90 | + |
| 91 | +### Usage |
| 92 | + |
| 93 | +```yaml |
| 94 | +--- |
| 95 | +layout: overview |
| 96 | +title: Module Overview |
| 97 | +--- |
| 98 | + |
| 99 | +# Module Name |
| 100 | + |
| 101 | +<section bg-neutral-100> |
| 102 | +<h2>Getting Started</h2> |
| 103 | +<p>This content uses static-content CSS for enhanced typography and section styling.</p> |
| 104 | +</section> |
| 105 | + |
| 106 | +<section bg-darkblue> |
| 107 | +<h2>Features</h2> |
| 108 | +<p>Full-width sections with fluid spacing and typography.</p> |
| 109 | +</section> |
| 110 | +``` |
| 111 | + |
| 112 | +### Best For |
| 113 | + |
| 114 | +- Module landing pages |
| 115 | +- Feature overviews |
| 116 | +- Product showcases |
| 117 | +- Marketing sections within documentation |
| 118 | + |
| 119 | +## Customizing Layouts |
| 120 | + |
| 121 | +### Sidebar Control |
| 122 | + |
| 123 | +All layouts support sidebar customization via frontmatter: |
| 124 | + |
| 125 | +```yaml |
| 126 | +--- |
| 127 | +layout: overview |
| 128 | +sidebar: false # Hide the primary sidebar |
| 129 | +--- |
| 130 | +``` |
| 131 | + |
| 132 | +```yaml |
| 133 | +--- |
| 134 | +layout: docs |
| 135 | +secondarySidebar: false # Hide the secondary sidebar only |
| 136 | +--- |
| 137 | +``` |
| 138 | + |
| 139 | +### Wide Content |
| 140 | + |
| 141 | +For documentation that needs more horizontal space: |
| 142 | + |
| 143 | +```yaml |
| 144 | +--- |
| 145 | +layout: docs |
| 146 | +wide: true # Expands content width |
| 147 | +--- |
| 148 | +``` |
| 149 | + |
| 150 | +## Static Content CSS |
| 151 | + |
| 152 | +The overview layout automatically imports the static-content CSS module which provides: |
| 153 | + |
| 154 | +### Enhanced Typography |
| 155 | + |
| 156 | +- Fluid font sizing that scales with viewport |
| 157 | +- Optimized line heights and spacing |
| 158 | +- Consistent heading hierarchy |
| 159 | + |
| 160 | +### Section Styling |
| 161 | + |
| 162 | +- Automatic section padding and margins |
| 163 | +- Background color transitions |
| 164 | +- Responsive spacing system |
| 165 | + |
| 166 | +### Usage Examples |
| 167 | + |
| 168 | +```html |
| 169 | +<!-- Fluid sections with automatic spacing --> |
| 170 | +<section bg-neutral-100> |
| 171 | + <h1>Main Heading</h1> |
| 172 | + <p>Automatic typography scaling</p> |
| 173 | +</section> |
| 174 | + |
| 175 | +<section bg-darkblue> |
| 176 | + <h2>Feature Section</h2> |
| 177 | + <p>Enhanced section spacing</p> |
| 178 | +</section> |
| 179 | + |
| 180 | +<!-- Wide sections without constraints --> |
| 181 | +<section nq-wide bg-neutral-0> |
| 182 | + <h2>Full Width Content</h2> |
| 183 | +</section> |
| 184 | +``` |
| 185 | + |
| 186 | +## Responsive Behavior |
| 187 | + |
| 188 | +### Desktop (≥1224px) |
| 189 | + |
| 190 | +- **docs**: Full sidebar layout with secondary sidebar |
| 191 | +- **home**: Header navigation with full content |
| 192 | +- **overview**: Sidebar + full-width main content |
| 193 | + |
| 194 | +### Mobile/Tablet (<1224px) |
| 195 | + |
| 196 | +- **docs**: Collapsible navigation with bottom mobile nav |
| 197 | +- **home**: Mobile nav at bottom |
| 198 | +- **overview**: Outline accordion + mobile nav at bottom |
| 199 | + |
| 200 | +## Migration Guide |
| 201 | + |
| 202 | +### From docs to overview |
| 203 | + |
| 204 | +```yaml |
| 205 | +# Before |
| 206 | +--- |
| 207 | +layout: docs # or no layout specified |
| 208 | +title: Module Guide |
| 209 | +--- |
| 210 | + |
| 211 | +# After |
| 212 | +--- |
| 213 | +layout: overview |
| 214 | +title: Module Guide |
| 215 | +--- |
| 216 | +``` |
| 217 | + |
| 218 | +This changes: |
| 219 | + |
| 220 | +- ❌ Removes secondary sidebar and breadcrumbs |
| 221 | +- ❌ Removes container padding |
| 222 | +- ✅ Adds static-content CSS styling |
| 223 | +- ✅ Enables full-width design flexibility |
| 224 | + |
| 225 | +### From home to overview |
| 226 | + |
| 227 | +```yaml |
| 228 | +# Before |
| 229 | +--- |
| 230 | +layout: home |
| 231 | +title: Module Landing |
| 232 | +--- |
| 233 | + |
| 234 | +# After |
| 235 | +--- |
| 236 | +layout: overview |
| 237 | +title: Module Landing |
| 238 | +--- |
| 239 | +``` |
| 240 | + |
| 241 | +This changes: |
| 242 | + |
| 243 | +- ✅ Adds primary sidebar for navigation |
| 244 | +- ✅ Adds static-content CSS styling |
| 245 | +- ✅ Maintains clean, container-free design |
0 commit comments