Skip to content
Snippets Groups Projects

fcos-suite-astro

This is a template for the Astro static site generator. You can clone this repository, modify the content and start your own website using the FCOS Suite look & feel. It's supposed to be an easy way for other Fab Cities, Makerspaces and other institutions to get their website up and running quickly while supporting Open Source workflows.

Translations

By default, the Astro site generator does not support translations (also called internationalization or i18n) out of the box. However we added a custom translation functionality:

  • Every translation of a page is a separate content file and they are added to separate top-level folders, e.g.
    • German content is located in the src/pages/de/ folder, English content is located in the src/pages/en/ folder
    • A translated page is a regular page like any other. Technically it can have completely separate content than the "original" (that wouldn't make a lot of sense, but you can decide do show more/less/modified content for a specific language version) and translations are also optional, so you don't need to translate every single page right away
    • To connect two pages, and indicate that one is a translation of the other, just add the slug: property to the frontmatter section of the translated page. E.g. your original file is src/pages/de/neue-webseite.mdx, and now you're creating the translated version under src/pages/en/new-website.mdx. Just add translated: de/neue-webseite to the english content file, to indicate that these two pages belong to each other
    • To go to the translated version of a page, you can either
      • Click on the language selector in the top header bar
      • Just change the locale part of a URL, e.g. if you're looking at https://myfabcity.com/de/news/neue-webseite and you want to go to the english version of this page, just change de to en (https://myfabcity.com/en/news/neue-webseite) and you will be redirected to the proper english page