This repository hosts the files for the documentation found on https://docs.terrapkg.com for the Terra repository.
From Fedoraland with love.
Steps to contributing or building the site found below.
To start, you will need Bun. Install it via any means of your choosing, and luckily, it's in Terra!
Below are some commands to either build the site to test your changes or to help you out.
| Command | Action |
|---|---|
bun ci |
Installs dependencies |
bun run dev |
Starts a local dev server at localhost:4321 |
bun run build |
Build the production site to ./dist/ |
bun run preview |
Preview your build locally |
bun run astro ... |
Run CLI commands like astro add, astro check |
bun run astro -- --help |
Get help using the Astro CLI |
The Terra docs use Lunaria to help with translation. If you would like to help translate them into your language, please do!
First, add your desired translation language to lunaria.config.json inside of "locales": []. The format is as follows:
"locales": [
{
"label": "Language",
"lang": "lang"
},
{
"label": "Language With Dialect",
"lang": "lang-co"
},
]Please see this page for the format of the short form aliases, which are a combination of the ISO 639 language codes and the ISO 3166 country codes.
Then, add your locale to the locales config in astro.config.mjs like this:
locales: {
lang: {
label: "Language",
lang: "lang",
},
},Afterwards, add a lang.json file to src/content/i18n. You can then customize the translated UI strings (recommended) following this guide. If you want to opt out of translating UI strings and use the fallback strings, simply use {} as the contents of the file.
Finally, add a translation for the page title to astro.config.mjs. The format is as follows:
{
label: "Page",
translations: {
lang: "Translated Title",
}
}The path translated pages must go in is src/content/docs/<language>/<path> with <language> being the shorthand of the language and <path> being the original path of the file. For example, the file src/content/docs/reference/faq.mdx translated into German would have to go into src/content/docs/de/reference/faq.mdx.
To learn more about the tools this site is built on, check out the below: