Skip to content

Initialize configuration

The primary configuration file for your LightNet project is astro.config.mjs. This file defines global configuration for your media library, such as the title, languages, base URL, and more.

Here is a minimal version of an astro.config.mjs file for a LightNet site:

astro.config.mjs
import lightnet from "lightnet";
import { defineConfig } from "astro/config";
export default defineConfig({
site: "https://yourdomain.com",
integrations: [
lightnet({
title: {
en: "My Library",
},
languages: [
{
code: "en",
label: {
en: "English",
},
isDefaultSiteLanguage: true,
},
],
}),
],
});

Customize the settings to match your needs.

  1. Site - The site property defines the base URL for your website. Update this to reflect your deployment URL.

    site: "https://yourdomain.com"
  2. Title - The title property sets the site title, which appears in the browser tab and header bar. Provide a locale map keyed by your configured site languages.

    title: { en: "My Library" }
  3. Languages - The languages section defines the languages known to your site. Use isDefaultSiteLanguage and isSiteLanguage to control which locales are available in the site UI. Refer to the Internationalization Guide for more details on managing locales and fallbacks.

    Each language also includes its display label as a locale map. For example:

    {
    "code": "en",
    "label": {
    "en": "English"
    },
    "isDefaultSiteLanguage": true
    }

More configuration options are available. Use the other guides in this chapter to customize your site further.