Skip to content

Set a Main Menu

LightNet supports adding a main menu in the header bar, displayed as a hamburger icon in the top right corner.
The menu can link to internal or external pages.

Here’s an example configuration:

astro.config.mjs
export default defineConfig({
integrations: [
lightnet({
// ...
mainMenu: [
{
href: "/",
label: "ln.home.title",
},
{
href: "/media",
label: "ln.search.title",
},
{
href: "/about",
label: "x.navigation.about",
},
{
href: "https://lightnet.community",
label: "LightNet",
},
],
}),
],
})

This example menu configuration links to:

Notice how the links do not include a locale. The locale is automatically added by LightNet.

  • href: Defines the link destination. It can be internal (e.g., /media) or external links (e.g., https://wikipedia.org). External links open in a new browser tab.
  • label: The text displayed on the menu item. Use a translation key for localized or a fixed string for non-localized labels.