Language

Worked Example: Changing One Theme Block From Scratch

Duplicate the built-in theme → edit the CSS → bump the version and save → activate and publish → verify on the list page, with what each step does and which step loses the effect if skipped.

This page walks through the smallest real change: make the title on each card of the content list page larger, and add a little spacing between cards — from opening the console to a visitor seeing the new version, what each step does, which step can be skipped, and which step, if skipped, leaves the change with no effect.

Step 0: first decide which copy you are changing

The built-in default theme ships with the binary and is replayed from the embedded version at startup. So editing the built-in theme directly and saving it under the same version number means the change is overwritten at the next start. The correct move is to choose duplicate on the theme card — that turns it into your own non-builtin theme, giving you an independent version line, while the built-in one stays the "back to factory" reference.

Step 1: enter the editor and read the file list

Under the console's Development and debugging domain there is a theme editor. The file list on the left comes from the files declared by this version's manifest: templates (theme.html and friends), styles (assets/theme.css), and other assets. Images and other binary assets are listed but cannot be opened — the interface honestly returns "not editable" with a reason, rather than handing you a button that must fail when clicked.

Step 2: change the stylesheet, not the template

This requirement only touches assets/theme.css. Find the list-card title selector, raise the font size, and add spacing to the card container. Do not stuff a <style> into the template for layout: styles live in the theme's own CSS, and the stylesheet a visitor page receives is exactly the CSS that version declared (the server concatenates them in manifest order), so putting it in the template would turn "which styles this version uses" into two answers.

Also do not hard-code direction-dependent left/right values: a multilingual site has right-aligned languages, and the spacing written with left/right in the current built-in theme is not mirrored. To cover both, use direction-neutral constructs (for example logical properties or symmetric spacing).

Step 3: raise the version number and save

The version in the manifest is the single owner of the version number — the "bump a version" control in the interface edits exactly that text field, and the save request carries no second version parameter. You must bump it: the new version number has to be higher than every version already in the database, otherwise it is refused. That is not pedantry — editing an already-registered version in place would make the snapshots and recovery points that reference it point at bytes whose content changed.

What the moment of saving does is register a new theme version: the manifest is parsed strictly (unknown fields are refused outright), the declared set of files maps one-to-one onto the actual bytes, and templates must pass Go's template parser. A template syntax error returns 422, not 400 — the request shape was fine, what failed is the theme's own syntax; the response puts this site's wording first with the server's original text in parentheses, so you can see at a glance which field it is.

Step 4: activate and publish (this step cannot be skipped)

At this point visitors still see the old page. The Activate and publish control on the theme card pops a confirmation that says which version will be activated and tells you explicitly that the pending site-wide changes — navigation, site configuration and so on — will be published together. Once you confirm, the system produces a new publish snapshot; the snapshot pins the theme version, and only then does the front end start using the new version.

"A version was saved" and "it is live" are two different things. That boundary deserves its own note: content edits take effect for visitors immediately, while site-level configuration (theme version, navigation, banners and announcements) all requires pressing publish.

Step 5: how to confirm you changed the right thing

Do not look only at the home page. This requirement touches the list page, so open the content list deliberately (for example /docs, /en/docs) — a list page needs the theme to supply its own template, and when only a content-page template is provided the list falls back to the content-page template, which does not render list entries: the page opens, the styles look right, and every entry is gone. This is the most common kind of "looks like it worked" in theme development.

While you are there, check two more things: a foreign-language page (to confirm the spacing does not break under a right-aligned language), and if you do not see the new version on refresh, first remember that public pages have a 60-second freshness window — during that time the browser answers, it is not that the server failed to update; to verify immediately, bypass the cache on refresh.

When you want to go deeper

If the requirement is "show one more field on the card", that is no longer a theme-layer change: the field has to enter the data contract first (the server struct, the field's own bilingual description, the documentation block people copy from, and the built-in theme template all move together), otherwise writing a name that does not exist in the template just draws nothing. The test is simple — ask GET /api/v1/themes/api: a field that is not in the self-description does not exist.