Manual Installation
This guide will walk you through installing and configuring Lunaria in your existing project manually.
1. Add the @lunariajs/core
package
Lunaria is published through the @lunariajs/core
package in the npm registry. Add it to your project by running the following command in the project’s root directory:
npm install @lunariajs/core
pnpm install @lunariajs/core
yarn add @lunariajs/core
Then, add the following lunaria
commands as part of your package.json
’s scripts
field:
"scripts": { "dev": "astro dev", "build": "astro build", "preview": "astro preview", "lunaria:build": "lunaria build", "lunaria:preview": "lunaria preview",}
2. Create lunaria.config.json
Lunaria is configured using lunaria.config.json
. This file is required so Lunaria knows about your repository structure and what should be tracked.
{ "$schema": "./node_modules/@lunariajs/core/config.schema.json"}
3. Configure the package
Before generating your first localization dashboard, you have to set up the repository
, defaultLocale
, and locales
fields of your lunaria.config.json
file.
The following example sets up Lunaria to track Markdown/MDX content for both English and Portuguese in a sample project, hosted on https://github.com/me/cool-project/
:
{ "$schema": "./node_modules/@lunariajs/core/config.schema.json", "repository": { "name": "me/cool-docs" }, "files": [ { "location": "content/**/*.md", "pattern": "content/@lang/@path", "type": "universal" } ], "defaultLocale": { "label": "English", "lang": "en" }, "locales": [ { "label": "Português", "lang": "pt" } ]}
Learn more about all the available options in the Configuration Reference guide.
4. Next Steps
Success, you’re now ready to start using Lunaria in your project!
If you followed this guide completely, you can jump to Build your first dashboard to learn how to generate your localization dashboard, see it in your browser, and our recommended next steps.