Skip to content

Max98/rigsofrods.github.io

Repository files navigation

Rigs of Rods website

This is the source code for Rigs of Rods website. It is 100% static, fast and secure but uses a myriad of web tech to compile and run as intended.

Technology

Here is the list and description of all technologies used to build and run the website.

Design

  • Foundation: loud shout out to the folks behind this framework that made rapid creation of nice looking websites possible.

Layouts, content and data

This is the core content of the website. Layouts, forms, prose, all written using this troika.

  • Slim: this is a templating language used instead of pure HTML. It allows to write layouts and custom pages faster (no more closing tags, really!) as well as embed select code for baking the website.

  • AsciiDoc: the syntax used for all content pages. This markup is much more featureful than Markdown, reStructuredText or MediaWiki.

  • YAML: the format of front matter and data lists. You can see it both in .yml files and at the top of some others delimited with ---.

Coding

The cogs of the website.

  • Ruby: compile-time logic for site generator.

  • JavaScript: client-side runtime code. Examples: smooth scrolling, locale-based redirection.

Translation

Special one and my favourite. Our website uses two distinct translation systems for different parts, UI strings/home page and content.

UI Strings and Home page

  • Ruby I18n: translations are YAML-formatted lists placed into /locales folder. Strings are called from layouts via identifiers through I18n class. Therefore translations are source language-independent. All changes to source lang must be manually reflected in translations!

Content pages

This is pure prose and having wall of texts in a single data file is unfeasible. Hence we take a different approach here.

  • gettext: internationalization system used in Rigs of Rods and thousands of other software projects. Translations are stored as .po files which contain pairs of source string and translation along with some meta info about the author, group, language etc.

  • po4a and po4a-bulk: gettext is a tool originally designed for software and software only. However, po4a authors beg to differ. This handy tool allows creation of gettext templates out of different document formats (AsciiDoc, man, POD and others) and generation of translated versions. po4a-bulk is a wrapper around po4a written by yours truly for handling large sets of files with po4a.

For every content file in /content directory po4a-bulk calls po4a which in turn calls gettext. Resulting PO files can be edited by hand (say hello to good ol' notepad) or via dedicated tool (GTranslator, POedit, Lokalize and others).

Baking

Hosting

Commands

  • make server - Start a test server: examine the website at localhost:4567.

  • make deploy - Build and deploy the website.


  • make gettextize - update gettext template files.

  • make updatepo - update gettext translation files.

  • make translate - create translated documents.

Contributing

See the Contributing Guide for more information.

License

Rigs of Rods website source code is available under the terms of GNU Affero General Public License v3 or any later version.

About

Rigs of Rods website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published