Skip to content

Configuration Reference

You configure the LightNet Astro integration in the astro.config.mjs file.

astro.config.mjs
import lightnet from "lightnet";
import { defineConfig } from "astro/config";
export default defineConfig({
site: "https://yourdomain.com",
integrations: [
lightnet({
/* Your config here */
}),
],
});

These are the available options:

type: string
example: "x.site.title"
required: true

The title of your site. For example shown on the the header bar. It can be a fixed string or a translation key to support multiple locales.

type: array
example: [{ code: "en", label: "English", isDefaultSiteLanguage: true }]
required: true

The site and content languages of your site.

type: string
example: "en"
required: true

The IETF BCP-47 code of the language. This code is used as the language’s identifier.

type: string
example: "English"
required: true

The name of the language. This is used as the language name in the language picker. It can be a fixed string or a translation key to support multiple locales.

type: boolean
example: true
required: false

Configure this language to be available as a site language. It shows up in the language picker in the menu bar. You do not need to set this, if you set isDefaultSiteLanguage to true.

type: boolean
example: true
required: false

If you set this to true, the language is used as the default site language. You must set exactly one language to be the default language. The default site language is used:

  • As the fallback language if a translation is not available for the current locale.
  • As the default language when the user navigates to the root URL path (/).

type: object
example: { src: "./src/assets/logo.png" }
required: false

The logo of your site to be shown in the header bar next to the site title.

type: string
example: "./src/assets/logo.png"
required: true

The path to the logo image. Provide a path to an image inside src/assets. Supported formats include jpg, png, svg and webp.
LightNet optimizes the image size for better performance (except for SVGs). We recommend providing an image file with a width and height of 150 pixels.

type: string
example: "x.logo.alt"
required: false

The alt text of the logo. This is used if the logo image is not available or if the user has disabled images, for example when using a screen reader. The value of the alt attribute can either be a fixed string or a translation key to support multiple locales.

type: number
example: 30
required: false
default: 28

The size of the logo in the header bar in pixels. This is applied to the shorter side of the logo image.

type: number
example: 30
required: false
default: false

If set to true, no title will show next to the logo on the header bar. Additionally, to support screen readers, the site title is set to the logo’s alt attribute. Use this option if your logo already includes your site title.

type: array
example: [{ rel: "icon", href: "favicon.ico" }]
required: false

The favicon of your site. Favicon is a small icon displayed in the browser tab and bookmarks.

LightNet’s API supports multiple favicon formats. Each entry in the favicon array maps to an HTML <link> element. For example:

Input:

astro.config.mjs
lightnet({
favicon: [
{
rel: "icon",
href: "favicon.ico",
sizes: "32x32",
},
],
});

Maps to the following HTML:

<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" sizes="32x32" />
</head>

type: string
example: "/favicon.svg"
required: true

Reference the favicon. This must be a path to an image inside the public/ directory.

type: "icon" | "apple-touch-icon"
example: "icon"
required: false
default: "icon"

This sets the rel attribute of the favicon. Refer to the MDN documentation for more information.

type: string
example: "32x32"
required: false

This sets the sizes attribute of the favicon. Refer to the MDN documentation for more information.

type: string
example: "/manifest.json"
required: false

This sets the manifest of the site. The file must be inside the public/ directory.

type: array
example: [{ href: "/about", label: "x.navigation.about" }]
required: false

This sets the main menu of the site. It is expected to be an array with at least one entry. Each entry is an object with the following properties:

type: string
example: "/about"
required: true

The link attribute of the main menu entry. The value can be an internal or an external link. Internal links are automatically prefixed with the current locale.

type: string
example: "x.navigation.about"
required: true

The label of the main menu entry. The value can be a fixed string or a translation key to support multiple locales.

type: boolean
example: false
required: false
default: true

Internal links are by default prefixed with the current locale (e.g., /media becomes /en/media for English).
To disable this, set requiresLocale property to false.

You don’t need to set this option for external links (e.g. https://wikipedia.org) since they won’t be prefixed anyways.

type: array
example: [ "files.your-domain.com" ]
required: false

The internal domains of the site. This is used to determine if an URL is internal or external.

For example if you want to link to your files on a different domain e.g. on a subdomain files.your-domain.com, you can add it to the internalDomains array. A link to https://files.your-domain.com/file.pdf won’t be treated as an external link.

type: string
example: "./src/components/MyHeadTag.astro"
required: false

Path to an Astro component to be added to the HTML head element of all pages.

For example this component would add a script to every page:

/src/components/MyHeadTag.astro
---
---
<script src="my-js-file.js" defer></script>

type: string
example: "./src/components/MyFooter.astro"
required: false

Path to an Astro component to be added at the bottom of all pages. Here is a guide on how to use the footer.

type: object
example: { filterByLocale: true }
required: false

Search page related settings.

type: boolean
example: true
required: false
default: false

If you set this to true, the search results are initially filtered by the current site language. The filter is applied when at least one media item is associated with that language. Users are still able to change the language filter’s value. By default the language filter is initially set to “All languages”.