Static Site Generation - jegr78/ctc-manager GitHub Wiki
CTC Manager generates a complete static HTML website from the current database state, suitable for hosting on GitHub Pages or any static file server.
| Component | Class | Purpose |
|---|---|---|
| Service | SiteGeneratorService |
Renders Thymeleaf templates to static HTML files |
| Controller | SiteGeneratorController |
Admin UI trigger for site generation |
| View Models |
sitegen.model package |
Data models for the generated pages |
| Page | Content |
|---|---|
| Index | Landing page with season overview and navigation |
| Standings | Current season team standings table |
| Driver Rankings | Individual driver rankings (season and all-time) |
| Matchday Pages | Per-matchday results with race details |
| Team Profiles | Team page with roster, results, and history |
| Driver Profiles | Individual driver page with race history |
| Playoff Brackets | Visual bracket display for playoff tournaments |
| Archive | Historical season data |
Team and driver profiles live at season/<season>/team/<slug>.html and season/<season>/driver/<slug>.html. The slug is derived from the team short name or PSN ID the first time a profile is generated and then stored, so it stays the same after a rename.
- Names that slugify alike, such as
A_BandA-B, get separate URLs. The profile that already had the URL keeps it, and the newer one gets a-2,-3suffix. - If several profiles shared one URL before slugs were stored, each of them gets a suffixed URL. The shared URL then shows a page linking to all of them, and the generation page lists every such URL as a warning.
The output directory is configurable. Default location:
~/ctc-site-output
In Docker deployments, the output goes to /app/data/site inside the ctc-data named volume.
Site generation is triggered manually from the admin UI. The process:
- Navigate to the site generation page in the admin panel
- Click "Generate" to start the process
- All pages are rendered from current database state into a staging directory next to the output directory
- Only a complete site replaces the output directory. If generation fails, the previously generated site stays in place, and the error is shown
- A second generation started while one is running is rejected. Start it again when the first has finished
The generated static files can be published directly to GitHub Pages:
- Generate the site via the admin UI
- Copy the output directory contents to a GitHub Pages repository
- Push to trigger GitHub Pages deployment
The generated HTML is self-contained and requires no server-side processing.