mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
describe how to use non-en lang in doc theme (#2447)
This commit is contained in:
parent
ef85fcc7ab
commit
1f45d23103
1 changed files with 13 additions and 0 deletions
|
@ -143,10 +143,23 @@ export const SIDEBAR = {
|
||||||
// ...
|
// ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you plan to use Spanish as the the default language, you just need to modify the redirect path in `src/pages/index.astro`:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
<script>
|
||||||
|
- window.location.pathname = `/en/introduction`;
|
||||||
|
+ window.location.pathname = `/es/introduction`;
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also remove the above script and write a landing page in Spanish instead.
|
||||||
|
|
||||||
### What if I don't plan to support multiple languages?
|
### What if I don't plan to support multiple languages?
|
||||||
|
|
||||||
That's totally fine! Not all projects need (or can support) multiple languages. You can continue to use this theme without ever adding a second language.
|
That's totally fine! Not all projects need (or can support) multiple languages. You can continue to use this theme without ever adding a second language.
|
||||||
|
|
||||||
|
If that single language is not English, you can just replace `en` in directory layouts and configurations with the preferred language.
|
||||||
|
|
||||||
### Search (Powered by Algolia)
|
### Search (Powered by Algolia)
|
||||||
|
|
||||||
[Algolia](https://www.algolia.com/) offers a free service to qualified open source projects called [DocSearch](https://docsearch.algolia.com/). If you are accepted to the DocSearch program, provide your API Key & index name in `src/config.ts` and a search box will automatically appear in your site header.
|
[Algolia](https://www.algolia.com/) offers a free service to qualified open source projects called [DocSearch](https://docsearch.algolia.com/). If you are accepted to the DocSearch program, provide your API Key & index name in `src/config.ts` and a search box will automatically appear in your site header.
|
||||||
|
|
Loading…
Add table
Reference in a new issue