The website opengamecompressor.de
  • HTML 74.5%
  • CSS 16.9%
  • Rust 6.5%
  • JavaScript 1.8%
  • Shell 0.3%
Find a file
SkyfaR 76cfd69232
Some checks failed
CI / Release build (legal placeholders filled) (push) Failing after 17s
CI / Format, lint, test, build and compare public/ (push) Successful in 34s
Merge pull request 'CI: build and check the site, fail on stale output' (#1) from ci into main
2026-10-07 07:17:17 +02:00
.forgejo/workflows CI: build and check the site, and fail on stale output 2026-10-07 04:04:15 +02:00
design Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
public Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
scripts Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
src Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
static Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
templates Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
.gitignore Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
Cargo.lock Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
Cargo.toml Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
LICENSE Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
README.md CI: build and check the site, and fail on stale output 2026-10-07 04:04:15 +02:00
rustfmt.toml Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00
site.toml Website for opengamecompressor.de 2026-10-06 23:34:31 +02:00

opengamecompressor.de

The website of OpenGameCompressor: English at /, German at /de/. Static HTML and CSS, a few lines of optional JavaScript, no cookies, and no request to any other host except one: the home page asks db.opengamecompressor.de for the database totals.

Build

cargo run --release                        # renders public/ and checks it
cargo run --release -- check               # checks public/ again without rendering
cargo run --release -- build --release     # as build, but fails while legal placeholders are unfilled
cargo test                                 # tests of the checks

The generator (src/, Rust with minijinja) reads site.toml, renders templates/pages/<lang>/<page>.html into public/<path>/index.html, copies static/ as it is, and writes 404.html, sitemap.xml and robots.txt. No Node toolchain and no system package beyond Rust is needed.

public/ is the output, and it is committed, so that the server only has to serve files. Rebuild before every commit that changes site.toml, templates/ or static/: CI (.forgejo/workflows/ci.yml) runs fmt, clippy, the tests and the build, and fails when the committed public/ differs from the build's output. For pushes to main a separate job also runs build --release; it fails until the legal placeholders are filled, and it does not run for pull requests, so it never blocks one.

To look at it locally, serve public/ at the root of any static server (all links are absolute):

python3 -m http.server -d public 8000      # then http://localhost:8000/

What the checks enforce

build runs them after rendering; any error fails the build.

  • Every internal link and #anchor resolves to a file and an element.
  • Nothing is loaded from another host: no remote src, stylesheet, icon, preload, srcset or CSS url(), no @import, and no URL inside a script. The only address scripts may contact is urls.stats, passed in a data-stats-url attribute.
  • No inline <script>, <style> or style="", as the Content-Security-Policy forbids them.
  • Every page has lang, a <title> and a meta description.
  • No file contains a test-fixture marker ("fixture"). Synthetic data must never reach public/.
  • Unfilled legal placeholders are listed as warnings; --release turns them into an error.

Before going live

  1. Fill [legal] in site.toml: name, postal address and e-mail for the Impressum and the privacy policy, where the site is hosted (hosting_en, hosting_de), and what the web server logs (hosting_logs: "none" or a number of days). Until then the pages show marked placeholders such as [NAME] and a red banner, and the build warns. Nothing in these pages is to be invented.
  2. Build with cargo run --release -- build --release.
  3. Serve public/ as the document root of opengamecompressor.de:
    • 404.html as the error page for missing paths (nginx: error_page 404 /404.html;);
    • the Content-Security-Policy of the pages also as a response header, with frame-ancestors 'none', which a meta tag cannot carry;
    • gzip or brotli for html, css, js, svg, xml and ttf; long cache lifetimes for /assets/fonts/;
    • access logs exactly as hosting_logs declares.
  4. db.opengamecompressor.de must answer /v1/stats.json with Access-Control-Allow-Origin (* per the CompressDB design, §5.4). If it does not answer, the home page keeps its static sentence.

The database totals

static/assets/js/site.js reads urls.stats and shows the totals if the JSON has them, in either shape:

{ "games": 1234, "results": 56789 }
{ "totals": { "games": 1234, "results": 56789 } }

results may also be called submissions or contributions. Without a count of games, with an error, or after 6 seconds, or when the JSON carries a top-level fixture: true (test data), the page stays as rendered; with "games": 0 it says that no results are published yet. The rating ladder next to it (templates/art/tiers.html) repeats the thresholds of the database's rules/verdict.toml; keep them in step.

Layout

Path What
site.toml URLs, legal details, the page list with titles and descriptions, interface strings in both languages
templates/base.html the page frame: head, CSP, meta and Open Graph tags, header, footer
templates/macros.html icons (inline SVG), command blocks, placeholders
templates/pages/{en,de}/ one template per page and language; privacy (German binding), impressum (German only)
templates/art/ the illustrations: gauge emblem, compression diagram, app frame, database ladder and totals
templates/legal/ operator block and the placeholder banner, shared by Impressum and privacy policy
static/assets/css/ site.css (tokens, base, header, footer), home.css, pages.css
static/assets/fonts/ Chakra Petch and IBM Plex, unmodified from the app, with their OFL licences
design/ sources of the raster images; scripts/render-images.sh renders them with a headless Chromium in Docker
public/ the built site

Design

The site uses the app's "Overdrive" identity: the palettes of src/gui/theme.rs in the app (dark by default, light when the system asks for it, stronger contrast with prefers-contrast: more), Chakra Petch for headings and labels, IBM Plex Sans and Mono for text and commands, square corners, and the app's glow and grid backdrop. Animations stop with prefers-reduced-motion. There is no theme switch, so nothing has to be stored in the browser.

The illustrations contain no figures that could be read as measurements. The app frame on the home page stands in for screenshots: templates/art/app-frame.html explains how to swap in real ones (taken with made-up games, never a real library).

German text uses the impersonal form, as the app does.

Content

What the pages say about the app follows its README. When a feature changes there, change it here; mark what is not released yet as planned (community database, ext4 container, automatic updates).

License

GPL-3.0-or-later, as the app (LICENSE). The fonts in static/assets/fonts/ are under the SIL Open Font License 1.1 (OFL-ChakraPetch.txt, OFL-IBMPlex.txt).