Learn how to start building your next documentation site with Stellar.
Create a new repo from this template.
Here are some vscode extensions you should install:
Astro
provides language support for .astro
files, syntax highlighting and more
Tailwind gives you intellisense for tailwind utility classes
Eslint intergrates eslint into vscode
MDX
adds language support for .mdx
files
Prettier integrates prettier into vscode
But even if you don’t install them it’s not that big of a deal.
Go to src/config.ts
and configure those values
Set GET_STARTED_LINK
to a link where user should go after he presses get
started button on landing page or docs link in nav (set it to first link in sidebar)
Go to src/astro.config.mjs
and inside site
enter your website url
If you want to have your docs only in one language (I don’t suggest you doing this unless you really want to) do the following:
Inside src/config.ts
set SINGLE_LANGUAGE
to true
if you haven’t already
Inside src/i18n/ui.ts
in LANGUAGES
object leave
only the language you want to use, and in the same file remove all data from
old languages
Inside src/i18n/sidebar.ts
delete all data from old languages
Inside src/components/navigation
in both Nav.astro
and MobileNav.astro
components inside getDocs
function leave
only language you want to use
Inside src/pages
delete all astro files that are not index.astro
and delete all folders except your lang folder
Inside src/i18n/ui.ts
in LANGUAGES
object add all
languages you wanna have your docs translated to
Inside src/i18n/sidebar.ts
delete all data from old languages,
and add data from new languages
Inside src/components/navigation
in both Nav.astro
and MobileNav.astro
components inside getDocs
add
cases for each language you wanna use.
src/pages
delete all folders except your current lang folders.Also inside src/pages
add a astro file for each lang except DEFAULT_LANGUAGE
defined in config.ts
e.g. You have 4 languages.
And let’s say you have only index.astro
.
You will create sr.astro
, es.astro
, and fr.astro
.
Basically for every language you create make a new astro page and name it after that language code, and import <LandingPage />
and pass LANDING_PAGE
object to t
prop with that language code property.