summaryrefslogtreecommitdiff
path: root/examples/docs
diff options
context:
space:
mode:
authorGravatar Jang Rush <weakish@gmail.com> 2022-01-24 23:32:27 +0800
committerGravatar GitHub <noreply@github.com> 2022-01-24 10:32:27 -0500
commit1f45d23103f96fce595366e8c1a9278991b7118f (patch)
tree0018c3d1addefd2fb7e88b3348e7070d574a0dbb /examples/docs
parentef85fcc7ab20c7bbecc19ec57462295769e66ec3 (diff)
downloadastro-1f45d23103f96fce595366e8c1a9278991b7118f.tar.gz
astro-1f45d23103f96fce595366e8c1a9278991b7118f.tar.zst
astro-1f45d23103f96fce595366e8c1a9278991b7118f.zip
describe how to use non-en lang in doc theme (#2447)
Diffstat (limited to 'examples/docs')
-rw-r--r--examples/docs/README.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/docs/README.md b/examples/docs/README.md
index 1a5e7040d..847db8d00 100644
--- a/examples/docs/README.md
+++ b/examples/docs/README.md
@@ -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?
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)
[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.