콘텐츠로 건너뛰기

수동 설치

이 가이드에서는 기존 프로젝트에 루나리아를 수동으로 설치하고 구성하는 방법을 안내합니다.

1. @lunariajs/core 패키지 추가

루나리아는 npm 레지스트리에서 @lunariajs/core 패키지를 통해 배포됩니다. 프로젝트 루트 디렉터리에서 다음 명령어를 실행하여 프로젝트에 추가하세요:

터미널 창
npm install @lunariajs/core

그런 다음, package.jsonscripts 필드에 아래와 같은 lunaria 명령어를 추가하세요:

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

2. lunaria.config.json 생성

루나리아는 lunaria.config.json 파일을 사용해 구성됩니다. 이 파일은 루나리아가 프로젝트 구조를 인식하고 어떤 내용을 추적해야 하는지 알 수 있도록 하기 위해 필요합니다.

lunaria.config.json
{
"$schema": "./node_modules/@lunariajs/core/config.schema.json"
}

3. 패키지 구성

첫 번째 번역 대시보드를 생성하기 전에, lunaria.config.json 파일의 repository, defaultLocale, locales 필드를 설정해야 합니다.

다음 예제는 샘플 프로젝트에서 영어 및 포르투갈어의 마크다운/MDX 콘텐츠를 추적하도록 루나리아를 설정하며, https://github.com/me/cool-project/에 호스팅된 상태입니다:

lunaria.config.json
{
"$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": "영어",
"lang": "en"
},
"locales": [
{
"label": "포르투갈어",
"lang": "pt"
}
]
}

구성 참조 가이드에서 사용 가능한 모든 옵션에 대해 자세히 알아보세요.

4. 다음 단계

성공적으로 완료했습니다! 이제 프로젝트에서 루나리아를 사용할 준비가 되었습니다!

이 가이드를 완전히 따르셨다면, 첫 번째 대시보드 만들기로 이동하여 번역 대시보드를 생성하고 브라우저에서 확인하며 추천되는 다음 단계를 배워보세요.