Type something to search...

Menu Configuration

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

OptionTypeDescription
mainarrayHeader navigation links
footerarrayFooter navigation links
navigation_buttonobjectCall-to-action button in header
OptionTypeRequiredDescription
namestringYesDisplay text
urlstringYesLink URL
childrenarrayNoDropdown items

Info

When a menu item has a children array, it becomes a dropdown menu automatically.

Add a prominent call-to-action button to the header:

{
  "navigation_button": {
    "enable": true,
    "label": "Get Started",
    "link": "/getting-started/"
  }
}
OptionTypeRequiredDescription
enablebooleanYesShow/hide the button
labelstringYesButton text
linkstringYesButton URL

Tip

Use the navigation button to highlight your most important page - a signup form, documentation, or featured content.

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/"
  }
}