Skip to content

Manual Installation

This guide will walk you through installing and configuring Lunaria in your existing project manually.

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:

Terminal window
npm install @lunariajs/core

Then, add the following lunaria commands as part of your package.json’s scripts field:

package.json
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"lunaria:build": "lunaria build",
"lunaria:preview": "lunaria preview",
}

Lunaria is configured using a lunaria.config.mjs file. This file is required so Lunaria knows about your repository structure and what should be tracked.

lunaria.config.mjs
import { defineConfig } from '@lunariajs/core/config';
export default defineConfig({});

Before generating your first localization dashboard, you have to set up the repository, sourceLocale, locales, and files fields of your lunaria.config.mjs file.

The following example sets up Lunaria to track Markdown content for both English and Portuguese in a sample project, hosted on https://github.com/me/cool-docs/:

lunaria.config.mjs
import { defineConfig } from '@lunariajs/core/config';
export default defineConfig({
repository: {
name: 'me/cool-docs',
},
sourceLocale: {
label: 'English',
lang: 'en',
},
locales: [
{
label: 'Português',
lang: 'pt',
},
],
files: [
{
include: ['content/en/**/*.md'],
pattern: 'content/@lang/@path',
type: 'universal',
},
],
});

Learn more about all the available options in the Configuration Reference guide.

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.