Toby Chui 857d9777d1 Redesign the document page 1 日 前
..
icons 857d9777d1 Redesign the document page 1 日 前
pages 857d9777d1 Redesign the document page 1 日 前
static 857d9777d1 Redesign the document page 1 日 前
templates 857d9777d1 Redesign the document page 1 日 前
README.md 857d9777d1 Redesign the document page 1 日 前
go.mod 857d9777d1 Redesign the document page 1 日 前
main.go 857d9777d1 Redesign the document page 1 日 前
main_test.go 857d9777d1 Redesign the document page 1 日 前
site.json 857d9777d1 Redesign the document page 1 日 前

README.md

sitegen — the os.aroz.org website

This folder builds the static ArozOS website into docs/, which GitHub Pages serves at https://os.aroz.org. The HTML in docs/ is generated: edit the files here and run the generator, never the pages in docs/.

cd scripts/sitegen
go run .          # writes the pages to ../../docs
go test ./...     # unit tests of the generator

It uses only the Go standard library and is its own module, so it never touches the ArozOS build in src/.

What is where

Path Holds
site.json Languages, the header navigation, shared interface strings (ui), the footer columns and the app icons the pages show
pages/<slug>.json One page each. index is the home page; every other file becomes <slug>.html
templates/layout.html The shared <head>, header, menus and footer
templates/sections.html One template per section type (see below)
icons/*.svg Inline icons, used by name ("icon": "cpu"). Add a file to add an icon
static/ site.css and site.js, copied to docs/assets/

The generator also writes docs/sitemap.xml, docs/robots.txt and docs/.sitegen-manifest.json (the list of files it wrote; a later run deletes the ones that are no longer produced). Everything else in docs/ (the screenshots, CNAME, the cluster whitepaper, older images) is left alone.

Text and translations

Every piece of text is either one string, used by every language, or an object with one entry per language:

"title": { "en": "Find anything. Fast.", "zh-tw": "想找什麼,立刻找到。", "zh-cn": "想找什么,立刻找到。", "ja": "探しものは、すぐに。" }
"title": "Musicify"

Text is trusted HTML, so <br>, <code>, <a href> and <span class="grad"> (gradient text) work. A language without its own entry falls back to English, and the generator prints those strings at the end of the run so they can be translated.

Adding a language: add it to languages in site.json (code is the key used in the text objects, dir the output folder, html the lang/hreflang value), then add its entries. Also teach the first-visit redirect in templates/layout.html how to recognise it in navigator.languages.

Links

Form Becomes
@media, @server#requirements That page in the current language
dl:arozos_linux_amd64 The file in the latest GitHub release (downloads in site.json)
/ArozOS-Cluster-Whitepaper.pdf A file at the root of docs/
anything else Used as written; http(s) links open in a new tab

A footer link to a page ({ "href": "@media" }) may leave out its label: the page's own nav name is used.

Pages and sections

A page file has nav (its short name), title, description, accent (the colour of its gradient: index, desktop, media, office, ai, makers, storage, server, download, defined at the top of site.css), feature (true adds it to the previous / next links at the bottom) and a list of sections. List a page in nav in site.json to put it in the header.

Every section has a type and may set tone (alt for a grey band, dark for a black band in both themes) and id (an anchor).

Type Draws Main fields
hero The page title with an optional big screenshot eyebrow, title, text, buttons, image; apps (floating icons) when the image is missing
feature A heading, text and a screenshot layout (stack, or split for side by side), flip, apps, eyebrow, title, text, bullets, note, image, code (a JavaScript sample), buttons
showcase One sticky screen whose picture and caption change as you scroll title, items (image, title, text), buttons
lit A large statement whose words light up as you scroll text
cards Large cards linking to other pages items (eyebrow, title, text, link, accent, image or apps, size: "wide")
bento A grid of small tiles items (icon or apps, title, text, value, link, size: wide, tall, full)
apps A grid of app icons apps, note, buttons
stats Big numbers (counted up when they appear) items (value, title, text)
specs A two-column specification list items (title, text or bullets), note
install Platform cards with commands and downloads items (link is the card's anchor, icon, title, eyebrow, text, code, bullets, buttons, note)
steps Numbered steps items (title, text)
cta A closing call to action title, text, buttons

Buttons take href, style (primary, secondary or link), an optional icon, and either a label or ui (a key of the shared strings in site.json, such as download or github).

Apps are referenced by their key in apps in site.json; their icons are copied from src/web on every run, so a new app icon shows up here too.

Screenshots

Images are named without an extension ("image": "shots/desktop") and looked up in docs/img/ as .webp, .png, .jpg or .svg. When a screenshot does not exist yet, its section is drawn without it and the generator lists it under "screenshots still to add", so a page can be written before its pictures are taken.

Save screenshots as WebP about 2200 px wide. macOS window captures keep their transparent shadow, which looks right on both themes:

cwebp -q 80 -alpha_q 90 -m 6 -resize 2200 0 capture.png -o docs/img/shots/name.webp

Behaviour

  • Theme: Light, Dark or Auto (follows the system), chosen from the header or the footer and kept in localStorage (aroz-theme). A small script in <head> applies it before the page paints.
  • Language: each language is its own set of pages (/, /zh-tw/, /zh-cn/, /ja/) with hreflang links between them. On the first visit to an English page, a browser set to Chinese or Japanese is sent to that language once; after that, the choice made in the language menu is kept (aroz-lang).
  • Motion: sections fade in as they scroll into view, screenshots scale up, the showcase steps through its pictures and the statement lights up word by word. All of it is switched off for visitors who ask for reduced motion.