- HTML 74.5%
- CSS 16.9%
- Rust 6.5%
- JavaScript 1.8%
- Shell 0.3%
| .forgejo/workflows | ||
| design | ||
| public | ||
| scripts | ||
| src | ||
| static | ||
| templates | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
| rustfmt.toml | ||
| site.toml | ||
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
#anchorresolves to a file and an element. - Nothing is loaded from another host: no remote
src, stylesheet, icon, preload,srcsetor CSSurl(), no@import, and no URL inside a script. The only address scripts may contact isurls.stats, passed in adata-stats-urlattribute. - No inline
<script>,<style>orstyle="", 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 reachpublic/. - Unfilled legal placeholders are listed as warnings;
--releaseturns them into an error.
Before going live
- Fill
[legal]insite.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. - Build with
cargo run --release -- build --release. - Serve
public/as the document root ofopengamecompressor.de:404.htmlas 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,xmlandttf; long cache lifetimes for/assets/fonts/; - access logs exactly as
hosting_logsdeclares.
db.opengamecompressor.demust answer/v1/stats.jsonwithAccess-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).