DEV Community

Cover image for A Zero-JS Static Site for a Game Companion on Cloudflare
RustLite
RustLite

Posted on Edited on

A Zero-JS Static Site for a Game Companion on Cloudflare

RustLite is a free companion for the survival game Rust. The product itself is a full web app. Alongside it we run a small brand hub, a handful of pages that explain what RustLite does and link out to it. This post is about that hub, because it's a nice example of how little you need for a fast, crawlable site.

Short version: six HTML pages, one CSS file under 3 KB, an SVG icon, and zero <script> tags, served from Cloudflare Pages.

Why a separate static hub at all?

The main app is dynamic. It does player lookups, live maps and calculators. That's great for users but it's a lot of moving parts for something whose only job is "explain the product and point to the right page."

A static hub gives us:

  • A page per feature, each with one clear purpose
  • Pages that load instantly on any connection
  • Nothing to patch, no server to keep alive, no build step to break
  • A stable place to link from profiles and directories

You can see the result at the RustLite hub homepage.

The whole file tree

site/
├── index.html
├── player-lookup.html
├── rust-plus.html
├── wiki.html
├── tools.html
├── around-the-web.html
├── 404.html
├── style.css          (~2.7 KB)
├── assets/radar-r.svg
├── robots.txt
├── sitemap.xml
├── _redirects
└── <indexnow-key>.txt
Enter fullscreen mode Exit fullscreen mode

That's it. No framework, no bundler, no node_modules.

Pretty URLs for free

The files are named tools.html, wiki.html and so on, but Cloudflare Pages serves them at /tools and /wiki without any config. The sitemap lists the clean versions, so search engines see one URL per page.

Styling with one tiny stylesheet

The whole look comes from a single style.css. The theme is a handful of CSS custom properties:

:root{
  --bg:#0b0e12; --panel:#12161c; --line:#232a33;
  --ink:#e8eaed; --mute:#9aa3ad;
  --acc:#f0641e; --acc2:#ff8a4a;
}
Enter fullscreen mode Exit fullscreen mode

Dark background, rust-orange accent. Headings use Barlow Condensed and labels use JetBrains Mono, both from Google Fonts with preconnect hints. Everything else is the system font stack, so body text renders before any web font arrives.

Layout is a centered .wrap with a max width, a .grid of .cards, and a couple of list styles. Every page reuses the same few classes, so a new page is mostly copy and paste.

Trade-off: the font request

Google Fonts is the one third-party request on the page. Self-hosting the two fonts would remove it. For a six-page hub we decided display=swap was good enough, but it's the first thing we'd change if we chased a perfect score.

An animated favicon with no JavaScript

The logo is an SVG: an orange "R" inside a radar scope. The sweep rotates with a SMIL <animateTransform>, and a contact "blip" fades in when the sweep passes it.

<animateTransform attributeName="transform" type="rotate"
  from="0 256 256" to="360 256 256" dur="4.2s" repeatCount="indefinite"/>
Enter fullscreen mode Exit fullscreen mode

Browsers that support SVG favicons get the animation inside the page header for free. No script, no GIF.

Content structure that helps people and crawlers

Each feature page follows the same pattern:

  1. A hero with one H1 and a one-line description
  2. A grid of cards, each linking to the matching deep page on the main app
  3. A short list of when you'd use it

The calculators and tools page is a good example. It explains the six most used tools in a sentence each, then links straight to them. The Rust wiki overview does the same for ten wiki sections.

Because the pages are plain HTML, the content that matters is in the first response. Nothing waits on hydration.

SEO plumbing

A static site still needs the boring parts:

  • robots.txt allows everything and points at the sitemap.
  • sitemap.xml lists the six pages with lastmod dates.
  • 404.html is picked up automatically by Pages and links back home.
  • _redirects holds a single rewrite for a search-console verification file, served with a 200 so the URL stays put.
  • IndexNow key file at the root, so we can ping participating search engines when a page changes instead of waiting for a crawl.

Deploying

Deploys go through Wrangler:

npx wrangler pages deploy site --project-name rustlite-hub
Enter fullscreen mode Exit fullscreen mode

Pages uploads only changed files, so a one-line copy edit ships in seconds.

What we'd do differently

  • Self-host fonts. Removes the only third-party request.
  • Add Open Graph tags and an image to every page. Shares currently fall back to the title and description.
  • Generate the cards from data. The listings page already comes from a JSON file. The feature pages are hand-written, which is fine at six pages and annoying at twenty.

FAQ

Do you need a framework for a small product site?

No. For a few pages that change rarely, hand-written HTML and one stylesheet are faster to load and easier to maintain.

Does Cloudflare Pages support clean URLs for .html files?

Yes. about.html is served at /about by default, with no redirect rules needed.

What is the hub actually for?

It's a short, fast overview of RustLite's features, like the Rust+ live map and raid alerts, that links to the full app at rustlite.com.

Questions about the setup? admin@rustlite.com

Top comments (0)