Configuration Reference
Configure the lightnet
integration
LightNet is an integration built on top of the Astro web framework.
You can configure the integration in your astro.config.mjs
file.
import lightnet from "lightnet";import { defineConfig } from "astro/config";
export default defineConfig({ site: "https://yourdomain.com", integrations: [ lightnet({ title: "Your Site's Name", }), ],});
You can pass the following options to the lightnet
integration:
title
type: string
example: "Your Site's Name"
required: true
The title of your site. This will be used as the title of the site and the header bar. It can be a fixed string or a translation key to support multiple locales.
languages
type: array
example: [{ code: "en", label: "English", translations: {}, isDefaultUILanguage: true }]
required: true
The languages of your site. This will be used to support multiple locales and content languages.
languages.code
type: string
example: "en"
required: true
The IETF BCP-47 code of the language. This code will be used as the language´s identifier.
languages.label
type: string
example: "English"
required: true
The name of the language. This will be used as the language name in the UI. It can be a fixed string or a translation key to support multiple locales.
languages.isUILanguage
type: boolean
example: true
required: false
Configure this language to be available as a user interface language. It will show up in the language picker in the menu bar.
You do not need to set this, if you set isDefaultUILanguage
to true.
languages.isDefaultUILanguage
type: boolean
example: true
required: false
If you set this to true
, the language will be used as the default user interface language.
You must set exactly one language to true
. The default user interface 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.
logo
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.
logo.src
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 a image file with a width and height of 150px.
logo.alt
type: string
example: "x.logo.alt"
required: false
The alt text of the logo. This will be 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.
logo.size
type: number
example: 30
required: false
The size of the logo in the header bar in pixels. This will be applied to the shorter side of the logo image.
favicon
type: array
example: [{ rel: "icon", href: "favicon.ico" }]
required: false
The favicon of your site. This will be used as the favicon of the site. Favicon is a small icon displayed in the browser tab and bookmarks.
Our API supports multiple favicon formats. Each entry in the favicon
array maps to an HTML <link>
element. For example:
Input:
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>
favicon.href
type: string
example: "/favicon.svg"
required: true
Reference the favicon. This must be a path to an image in the public/
directory.
favicon.rel
type: "icon" | "apple-touch-icon"
example: "icon"
required: false
default: "icon"
The rel attribute of the favicon. This will be used to set the rel attribute of the favicon. Refer to the MDN documentation for more information.
favicon.sizes
type: string
example: "32x32"
required: false
The sizes attribute of the favicon. This will be used to set the sizes attribute of the favicon. Refer to the MDN documentation for more information.
manifest
type: string
example: "/manifest.json"
required: false
The path to the manifest file. This will be used to set the manifest of the site. The file is expected to be in the public/
directory.
mainMenu
type: array
example: [{ href: "/about", label: "x.navigation.about" }]
required: false
The main menu of the site. This will be used to set 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:
mainMenu.href
type: string
example: "/about"
required: true
The link attribute of the main menu entry. The value can be a relative URL or an absolute URL.
mainMenu.label
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.
mainMenu.requiresLocale
type: boolean
example: false
required: false
default: true
Relative URLs are by default prefixed with the current locale (e.g., /media
becomes /en/media
for English).
To disable this, set requiresLocale
property to false
.
This option will be ignored if the path is absolute (e.g. https://wikipedia.org
).
internalDomains
type: array
example: ["files.your-domain.com"]
required: false
The internal domains of the site. This will be used to determine if a link is internal or external.
For example if you want to link to files on your subdomain files.your-domain.com
, you can add it to the internalDomains
array.
Your link to https://files.your-domain.com/file.pdf
won’t show up as an external link in the UI.
searchPage
type: object
example: { filterByLocale: true }
required: false
Search page related settings.
searchPage.filterByLocale
type: boolean
example: true
required: false
default: false
If you set this to true
, the search page will be initially filtered by the current UI language.
The filter will only be set when there is any media item in the current language.
Configure the decapAdmin
integration
LightNet Decap Admin is an Astro integration built on top of the Decap CMS headless CMS.
You can configure the integration in your astro.config.mjs
file.
import lightnet from "lightnet";import decapAdmin from "@lightnet/decap-admin";import { defineConfig } from "astro/config";
export default defineConfig({ integrations: [ lightnet({...}) decapAdmin({ languages: [{...}], }), ],});
You can pass the following options to the decapAdmin
integration:
languages
type: array
example: [{ code: "en", label: "English", translations: {}, isDefaultUILanguage: true }]
required: true
The languages of your site. This will be used to support multiple locales and content languages.
You should use the same languages as in the lightnet
integration. We recommend creating a shared variable that is used in both integrations.
See the lightnet configuration for more information on the languages structure.
path
type: string
example: "admin"
required: false
default: "admin"
The path to the admin page.
imagesFolder
type: string
example: "images"
required: false
default: "images"
The name of the images folder next to your content files. Change this if you want to use a different name for the images folder.
For example if your images stored inside a folder src/content/media/covers
, you can set this to "covers"
.
backend
type: object
example: { name: "gitlab", repo: "your-org/your-site", appId: "12345abcd" }
required: false
This configures the git host that your Administration UI is connected to. Currently we support GitLab and GitHub backends. The configuration directly maps (replacing snake_case with camelCase) to the Decap CMS GitHub and GitLab backend configuration.
backend: "gitlab"
GitLab backend configuration has this options:
- name:
"gitlab"
(required) this selects the GitLab backend. - repo:
string
(required) the GitLab repository path of your site. - appId:
string
Application ID from the sites GitLab settings. Our guide on the Administration UI shows how to get this. - branch:
string
the branch that is used for the Administration UI. Default is"main"
. - authType:
"pkce"
the authentication type to use. Default and only option is"pkce"
.
backend: "github"
GitHub backend configuration has this options:
- name:
"github"
(required) this selects the GitHub backend. - repo:
string
(required) the GitHub repository path of your site. - branch:
string
the branch that is used for the Administration UI. Default is"main"
. - baseUrl:
string
the URL of your service doing the authentication request.