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
-
If you haven’t already, follow the steps to add Lunaria to your project in the Getting Started guide.
-
Add the
@lunariajs/starlightto your project with your preferred package manager:Terminal window npm install @lunariajs/starlightTerminal window pnpm install @lunariajs/starlightTerminal window yarn add @lunariajs/starlight -
Add the
@lunariajs/starlightplugin to Starlight’spluginsarray 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:
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:
export default defineConfig({ integrations: [ starlight({ plugins: [lunaria({ route: "/dashboard", })], }), ],});configPath
Type: string
Default: "./lunaria.config.json"
The relative path to your Lunaria configuration file:
export default defineConfig({ integrations: [ starlight({ plugins: [lunaria({ configPath: "./lunaria/config.json", })], }), ],});