Skip to content

Starlight

The @lunariajs/starlight package integrates Lunaria into the Starlight documentation theme for Astro, adding the Lunaria dashboard as part of your Astro site with Starlight.

Set up

  1. If you haven’t already, follow the steps to add Lunaria to your project in the Getting Started guide.

  2. Add the @lunariajs/starlight to your project with your preferred package manager:

    Terminal window
    npm install @lunariajs/starlight
  3. Add the @lunariajs/starlight plugin to Starlight’s plugins array field:

    astro.config.mjs
    import starlight from '@astrojs/starlight';
    import lunaria from '@lunariajs/starlight';
    import { defineConfig } from 'astro/config';
    export default defineConfig({
    integrations: [
    starlight({
    plugins: [lunaria()],
    }),
    ],
    });

Usage

By default, a new /lunaria route will be added to your Astro site and will be built alongside your site’s production build. This route can be changed using the integration’s route option.

Your dashboard will also be available during development, although the first access might be slow thanks to Lunaria generating its status on the spot. The status will be cached for subsequent navigations and will be invalidated when a new commit is added.

Options

sync

Type: boolean
Default: false

Specifies if your Lunaria configuration’s defaultLocale, locales, and files fields should be synced with your Starlight i18n configuration when you use the astro build command:

astro.config.mjs
export default defineConfig({
integrations: [
starlight({
plugins: [lunaria({
sync: true,
})],
}),
],
});

route

Type: string
Default: "/lunaria"

The route where the Lunaria dashboard will be injected on. The value must be a valid Astro route pattern string:

astro.config.mjs
export default defineConfig({
integrations: [
starlight({
plugins: [lunaria({
route: "/dashboard",
})],
}),
],
});

configPath

Type: string
Default: "./lunaria.config.json"

The relative path to your Lunaria configuration file:

astro.config.mjs
export default defineConfig({
integrations: [
starlight({
plugins: [lunaria({
configPath: "./lunaria/config.json",
})],
}),
],
});