Rust Edu is an organization dedicated to supporting Rust education in the academic environment. This repository is the source of its website, https://rust-edu.org/: the pages are Markdown files, and the site's own small static site generator, written in Rust with only the standard library, builds them.
| To | Read |
|---|---|
| Write a news post, the site's blog | docs/new-post.md |
| Change another page, or add a resource | docs/editing.md |
| Run, check, preview or deploy the site | this file |
Understand or change the generator in crates/ |
docs/generator.md |
| Look up why the site is built this way | docs/design/: plans and research notes, a record and not a guide |
To report a suspected vulnerability in the site, generator, or deployment workflow, see the security policy.
To contribute or run this website locally, follow the steps below.
To change only the content, see docs/editing.md: every page is a Markdown file under content/.
- Docker with Compose, which runs the generator in the image that CI and the deploy use
- or Rust, with the toolchain pinned in
rust-toolchain.toml
Clone the repository:
git clone https://github.com/rust-edu/rust-edu.github.io.git
cd rust-edu.github.ioStart a local server:
docker compose upYour site will be live at: http://127.0.0.1:1111, drafts too.
After a change, reloading the page builds the site again; while the site has errors, the page shows them instead.
With Rust installed, make serve does the same.
| Path | What it holds |
|---|---|
content/ |
The pages, one Markdown file each, and the files they link to, such as PDFs |
layouts/ |
The HTML layout of each kind of page; layout.html also holds the two short scripts of the theme button, the site's only JavaScript (without it, the site follows the system's theme) |
static/ |
The images and style.css, the whole stylesheet: plain CSS with its colors in token blocks at the top, light and dark |
site.yaml |
The site's address, title and description, and the menu, next-step (hero) and footer links |
urls.yaml |
The addresses that other sites may link to (keep) and the addresses that redirect elsewhere (redirects) |
crates/ |
The generator: yaml, markdown, template and site, which has the edu binary |
docs/ |
The contributor guides above, docs/design/ (plans and research notes), and docs/ai/ (AI policy and LLM specs) |
public/, site/, preview/ |
Build output, ignored by git. Never edit it. |
A small generator in crates/, four crates on the Rust standard library alone, checks every page and link and
builds the site. docs/generator.md explains how it works and gives the rules of a change to it.
Each job is one command of the Makefile:
| Command | What it does |
|---|---|
make check |
Runs the guards, checks format and lint, checks every page and link, then runs the tests. It needs Rust, and it must pass before a change is done. |
make guards |
Checks three rules that the build cannot see: Cargo.lock lists only our crates, the live stage is FROM check, and the Dockerfile and rust-toolchain.toml name the same Rust. |
make ci |
Runs what CI runs on a pull request: the guards, then the same checks in CI's pinned Docker image, where the site is built twice to see that both builds are the same. It needs Docker. |
make preview |
Builds the site with its drafts into preview/, as CI does for the reviewers of a pull request. It needs Docker. |
make serve |
Serves the site with its drafts at http://127.0.0.1:1111, and builds it again on a reload after a change. It needs Rust, and runs until stopped. |
An error of the page check names the file, line and column of the mistake, usually with a hint. Fix the cause; do not weaken a check or a test to make it pass.
With Rust installed, rust-toolchain.toml selects the pinned toolchain,
and the generator's commands run by themselves too:
cargo run -p edu-site -- check
cargo testedu build writes the site into public/, for the base_url of site.yaml or for the address of --base-url:
cargo run -p edu-site -- buildThe checks of each pull request attach the site with its drafts as site-preview; its links start at the top of a
site, so serve the unpacked folder at the root of an address, as with python3 -m http.server -d site-preview 1111,
rather than opening its files. make preview writes the same site into preview/.
.github/workflows/deploy.yml runs on each push to main: it checks and builds the site in Docker and publishes it
with GitHub's own Pages actions, at the address that Pages gives the site, which the build takes as --base-url. It
needs Settings → Pages → Source set to GitHub Actions; a fork with that setting gets the site at its own Pages
address. Actions → Deploy to GitHub Pages → Run workflow runs it again by hand. Locally,
docker build --target site -o site . writes the same site, for rust-edu.org, into site/.
A push to main publishes the site, so make each change on a branch and propose it in a pull request, whose
description starts from .github/pull_request_template.md. These keep a bad change from going live:
FROM check AS livein theDockerfilebuilds the live site on the stage that ran the checks, which is what stops a bad push from publishing. Keep it; the guards fail when it changes.rust-toolchain.tomland theFROMtag of theDockerfilename the same Rust. Change them together; the guards fail when they differ.- CI runs
make ciandmake preview.ci.ymladds only what belongs to GitHub: when the checks run, what they may read, the errors shown on the lines of a pull request, and the preview as a download. Put a new check in theMakefile, so that it runs on a laptop too. .dockerignoreis an allowlist and theDockerfilecopies paths by name, so a new top-level file or folder that the build needs has to be added to both.- The GitHub Actions are pinned by commit and the Docker image by digest. Keep them pinned: Dependabot proposes
updates of the actions, and of the Docker image together with
rust-toolchain.toml, so that a Rust release bumps both in one pull request.
Most of the generator in crates/, its tests, the layouts, the stylesheet and the docs were written with Claude Code
(Anthropic), at the direction of Ken Esparta, who read each change in its pull request. docs/ai/
has the whole acknowledgement, with the models and what each tool did, explains what is asked of a contributor who uses
an AI tool, and lists the separate documentation written for LLMs.
Interested in contributing or learning more?
- 🌐 Visit: https://rust-edu.org/
- 📰 Follow the news in a feed reader: Atom or RSS
- 📧 Email: contact@rust-edu.org Let’s build the future of Rust education together!