Repository navigation
Templates: Rewrote the architecture guide for the Forgejo theme - #147
Merged
Merged
Conversation
gitea/ held 15 upstream Gitea files that update:gitea refreshed from go-gitea at the tag of the theme's own version, a number that follows this theme's releases and not Gitea's, and nothing read them. They go with the script, its proxy helper and the undici dependency only it used. Vite copied public/ into dist/ and the assembler then copied the page stylesheets into the Forgejo tree twice, once from public/ and once from dist/. Vite now leaves public/ alone (publicDir: false), so dist/ holds only the themes and the assembler copies public/ itself. The assembler also copies every stylesheet in styles/pages instead of a hand-written list; a test checks that each one is linked from component_assets.tmpl, so a new page stylesheet only needs that link. dist/forgejo is byte for byte the same as before. The preview ran its one-off chown and cleanup containers on Forgejo 16.0.3 while Compose ran 17.0.0; the constant now names 17.0.0 and a test keeps it equal to the Compose service's image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preview added ?preview=<revision> to the auto themes' imports in dist/forgejo itself, so src/build-output.test.ts failed after any dev:forgejo session until the next bun bundle. The stamp also went after the path, before the content version the bundle had already appended, which made links with two question marks such as theme-github-dark.css?preview=<id>?v=<hash>. ThemeSynchronizer now copies the built css and js into dev/.generated/public/assets, and the reloader stamps that copy and writes preview-revision.json there. The Compose file mounts it instead of dist, and a sync recreates the container rather than restarting it, so a preview started before this change picks up the new mounts. The revision joins any existing query with &, keeping one query per link. The fixture README explains how to sign in as sam, whose password is preview-fixture like every fixture user other than alex. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The template overrides are copies of Forgejo's templates, but nothing recorded which release they came from, so an upgrade showed no sign of the overrides that fell behind. The forgejo field of package.json now pins that release. The preview derives its image from it, which also replaces the 16.0.3 image its docker run commands still named, and a test checks that docker-compose.yml runs the same release. bun drift checks out the templates of a release into node_modules/.cache/forgejo with a sparse git clone and lists each override by the lines the theme added and removed, then the templates Forgejo does not have. Given two releases, it lists the overridden templates Forgejo changed between them with Forgejo's diff, and the ones it added or removed, so a maintainer knows what to port. CONTRIBUTING.md describes the steps in a new Upgrading Forgejo section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ARCHITECTURE.md still described the Gitea CSS generator, with a short Forgejo section on top and a single-file Gitea constraint. It now describes the two parts the theme ships: the theme stylesheets built from the palette pipeline and styles/, and the template pack that scripts/assembleForgejo.ts puts together from templates, components, page CSS and public assets. It covers asset versions, the local preview and the release archives, and the palette pipeline is kept, shorter. CONTRIBUTING.md gains where new styles go (styles/ for Forgejo's own markup, components/ for reusable UI, styles/pages for one page, public/ for an asset one template loads), the class prefixes and the z-index scale from motion.css. Its directory table lists components, page CSS, public and dev, and stale references now name component_assets.tmpl, the sidebar toggle component, results.js and the select example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
whereareiam
force-pushed
the
feat/template-drift-check
branch
from
October 28, 2026 18:28
6f68928 to
c209a0e
Compare
whereareiam
force-pushed
the
docs/forgejo-architecture
branch
from
October 28, 2026 18:28
f093fce to
b82f91d
Compare
whereareiam
enabled auto-merge (rebase)
October 28, 2026 18:28
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ARCHITECTURE.md still described the Gitea CSS generator: it named the project "Gitea GitHub Theme", described a "single-file Gitea constraint", and covered Forgejo only in a short section at the top. CONTRIBUTING.md had stale paths and never mentioned
styles/pages.ARCHITECTURE.md now describes the two parts the theme ships:
dist/theme-github-*.css): built from the palette pipeline and the TypeScript overrides instyles/. The pipeline description is kept, in a shorter form.dist/forgejo):scripts/assembleForgejo.tsbuilds it fromtemplates/,components/,styles/pages/andpublic/.It also adds a source layout table and covers how asset links get their content version, the local preview, the release archives and the tests. The key decisions now explain why a rule for Forgejo's own markup belongs in
styles/and a rule for the theme's markup sits beside its template.CONTRIBUTING.md gains three rules:
styles/for Forgejo's own markup,components/for reusable UI,styles/pages/*.cssfor page-only CSS, andpublic/only for assets that a page template links itself.theme-*for shared components,github-*for layout and state hooks on overridden templates, and a page prefix such asprofile-,org-oractions-for page-only CSS.motion.css.The directory table now lists
components,styles/pages,publicanddev. Stale references now point tobase/component_assets.tmpl,components/common/sidebar/toggle,results.jsandprofile_package_versions.tmpl.Documentation only; the build output is unchanged.
Release notes
Area: Descriptionwith a listed areaBranches: Fixed ...feature,change,bug,dependencies, orskip-changelogbugonly for a bug that shipped in a release; a fix for a bug that only existed ondevisskip-changelogmajoradded when admins must act on upgrade, for example a new minimum Forgejo version.github/release-notes.md, if admins need themChecks
🤖 Generated with Claude Code