Skip to content

Render the banner and switchers in the theme, and drop the settings it now provides - #1761

Merged
jpmckinney merged 3 commits into
1.1-devfrom
theme-migration-1.1
Oct 9, 2026
Merged

jpmckinney merged 3 commits into
1.1-devfrom
theme-migration-1.1

Conversation

@jpmckinney

@jpmckinney jpmckinney commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Renders the sidebar's banner and switchers in the theme instead of through Apache's mod_include, and drops the settings the theme now provides. Phase 1 of open-contracting/deploy#266 (comment).

This is the branch that reaches the live documentation. #1755 is the same four commits cherry-picked onto 1.2-dev, so that 1.2 doesn't ship without them.

What this replaces

Before After
<!--#include virtual="$BANNER" -->, resolved per path by SetEnv BANNER the theme's banner, from versions.json
<!--#include virtual="/includes/version-options.html" --> the switcher's options, from versions.json
language form posted to /{version}/switcher, rewritten from the HTTP referer client-side navigation, with relative <noscript> links as the fallback
html_theme_path, locale_dirs, html_favicon, analytics_id, copyright, license_name, license_url, docs/_templates/footer.html theme defaults, and the sphinx.html_themes entry point

versions.json is served by salt/docs/init.sls in the deploy repository, already applied. It stays a deployment artifact, edited on release, so that a new version reaches the pages of every earlier version without rebuilding them.

The resulting html_theme_options matches standard_profile_template@latest apart from display_version and the three languages.

One deliberate loss

The language_options block wrapped the languages in <optgroup label="Supported translations">. A flat languages dict can't express that, so the grouping goes. It has labelled every option since Italian was removed in 3108313 (2021-05-08), so nothing is distinguished by it today — but a future community translation would sit among the supported ones unmarked. open-contracting/standard-development-handbook#295 tracks that, along with the procedure that still tells you to edit the deleted block.

Verified

Built all three languages from a clean install of the theme from open_contracting, as CI does:

  • no <!--#include in the output, and pytest -W error passes
  • the favicon, the privacy notice, data-site="HTWZHRIZ" and the licence all still render, now from the theme
  • the switcher placeholders are translated for the first time — Versión/Idioma and Version/Langue — because the theme's catalogs ship now; Next was untranslated on the Spanish documentation of every root before this
  • the language links are relative and resolve to the same page: ../../../es/schema/release/

🤖 Generated with Claude Code

jpmckinney and others added 3 commits October 8, 2026 16:59
…pache's server-side includes

The theme reads a versions.json served next to the documentation root, which any host can serve, in place of the
`$BANNER` and version-options includes that Apache's mod_include resolves at request time. `versions_url` defaults
to it, so only the block goes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
The option also emits relative links as the no-JavaScript fallback, in place of a form posted to
`{root}/{version}/switcher`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
The theme registers itself and its catalogs through the `sphinx.html_themes` entry point, and defaults the options
that every documentation repository set alike, ships the favicon, and adds the privacy notice to its footer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL
@jpmckinney
jpmckinney force-pushed the theme-migration-1.1 branch 2 times, most recently from fa6c902 to 2467afa Compare October 9, 2026 00:33
@jpmckinney jpmckinney added this to the Minor: Build changes milestone Oct 9, 2026
@jpmckinney
jpmckinney merged commit c84ff0f into 1.1-dev Oct 9, 2026
11 checks passed
@jpmckinney
jpmckinney deleted the theme-migration-1.1 branch October 9, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant