astrolock.yaml navigation reference
Configure site navigation in .astrolock/astrolock.yaml.
Structure
{
"main": [
{ "name": "Home", "url": "/" },
{ "name": "Blog", "url": "/blog/" }
],
"footer": [{ "name": "Privacy", "url": "/privacy/" }],
"navigation_button": {
"enable": true,
"label": "Get Started",
"link": "/getting-started/"
}
}
Top-Level Options
| Option | Type | Description |
|---|---|---|
main | array | Header navigation links |
footer | array | Footer navigation links |
navigation_button | object | Call-to-action button in header |
Menu Item Options
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display text |
url | string | Yes | Link URL |
children | array | No | Dropdown items |
Info
When a menu item has a children array, it becomes a dropdown menu
automatically.
Navigation Button
Add a prominent call-to-action button to the header:
{
"navigation_button": {
"enable": true,
"label": "Get Started",
"link": "/getting-started/"
}
}
| Option | Type | Required | Description |
|---|---|---|---|
enable | boolean | Yes | Show/hide the button |
label | string | Yes | Button text |
link | string | Yes | Button URL |
Tip
Use the navigation button to highlight your most important page - a signup form, documentation, or featured content.
Dropdown Menus
Create dropdown menus by adding a children array:
{
"main": [
{
"name": "Content",
"url": "#",
"hasChildren": true,
"children": [
{ "name": "Blog", "url": "/blog/" },
{ "name": "Mixes", "url": "/mixes/" },
{ "name": "Gallery", "url": "/gallery/" }
]
}
]
}
Info
Set hasChildren: true when using dropdown menus. The parent url can be
"#" if you don’t want it to link anywhere.
Complete Example
{
"main": [
{ "name": "Home", "url": "/" },
{ "name": "Blog", "url": "/blog/" },
{
"name": "Media",
"url": "#",
"hasChildren": true,
"children": [
{ "name": "Mixes", "url": "/mixes/" },
{ "name": "Gallery", "url": "/gallery/" }
]
},
{ "name": "About", "url": "/about/" }
],
"footer": [
{ "name": "Privacy Policy", "url": "/privacy/" },
{ "name": "Contact", "url": "/contact/" }
],
"navigation_button": {
"enable": true,
"label": "CLI Reference",
"link": "/user-guide/commands/"
}
}