@lunariajs/starlight v0.0.6
@lunariajs/starlight
The @lunariajs/starlight
package integrates Lunaria into the Starlight documentation theme for Astro.
Read the official Lunaria documentation to learn more about it.
Installation
You can install @lunariajs/starlight
using your preferred package manager:
# npm
npm install @lunariajs/starlight
# pnpm
pnpm add @lunariajs/starlight
# yarn
yarn add @lunariajs/starlight
To use @lunariajs/starlight
properly you also need to install Lunaria's core package:
# npm
npm install @lunariajs/core
# pnpm
pnpm add @lunariajs/core
# yarn
yarn add @lunariajs/core
Basic Usage
Start using @lunariajs/starlight
by setting up your own lunaria.config.json
file and adding the provided integration to your astro.config.*
file.
// lunaria.config.json
{
"repository": {
"name": "me/cool-docs"
}
}
When using @lunariajs/starlight
you only need to provide a repository
field to get started, as defaultLocale
, locales
, and files
can be generated by enabling sync
in the integration's configuration. Do run astro build
one first time before other commands to avoid validation errors during development.
// astro.config.mjs
import starlight from '@astrojs/starlight';
import lunaria from '@lunariajs/starlight';
import { defineConfig } from 'astro/config';
export default defineConfig({
integrations: [
starlight({
plugins: [
// All options are optional, values shown are the defaults.
lunaria({
// A relative path to your Lunaria configuration file.
configPath: './lunaria.config.json',
// The desired route to render the Lunaria dashboard.
route: '/lunaria',
// Option to enables syncing the Lunaria configuration file
// with Starlight's configuration whenever you run
// `astro build`, populating the Lunaria config's `defaultLocale`,
// `locales`, and `files` fields automatically.
sync: false,
}),
],
}),
],
});
After setting up the integration, you can run astro dev
or astro build
and go to the specified route, e.g. https://localhost:4321/lunaria
to see your localization dashboard.