Skip to content

Render the banner, version switcher and language switcher in the theme - #1755

Merged
jpmckinney merged 3 commits into
1.2-devfrom
versions-json
Oct 9, 2026
Merged

jpmckinney merged 3 commits into
1.2-devfrom
versions-json

Conversation

@jpmckinney

@jpmckinney jpmckinney commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Phase 1 of open-contracting/deploy#266 (comment), for the last of the six documentation repositories.

The same three commits as #1761, cherry-picked onto 1.2-dev so that 1.2 doesn't ship without them. #1761 is the one that reaches the live documentation.

  • Delete the version_options block, so that the banner and version switcher no longer use Apache's server-side includes. versions_url defaults to ../versions.json in the theme, so nothing is set here.
  • Set languages and delete the language_options block. The language switcher's no-JavaScript fallback is now relative links, rather than a form posted to /{version}/switcher.
  • Drop the settings the theme now provides: html_theme_path, the theme's locale_dirs entry, html_favicon, analytics_id, copyright, license_name, license_url, and the footer.html override. The theme registers itself and its catalogs through the sphinx.html_themes entry point.

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

/1.0/ is untouched: it keeps its server-side includes, and stays in the root versions.json, so the switcher on /latest/ and /1.1/ still offers it. 1.1 is deliberately absent from versions.json, so /1.1/ shows no banner, as today.

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

Checked: all three languages build with no <!--#include, and pytest -W error passes. The favicon, privacy notice, data-site="HTWZHRIZ" and the licence all still render, 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.

https://claude.ai/code/session_01UAeUtu5XGYmmSwtyjVU7gL

🤖 Generated with Claude Code

jpmckinney and others added 3 commits October 8, 2026 20:32
…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
(cherry picked from commit d19e3bd)
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
(cherry picked from commit 3067ea7)
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
(cherry picked from commit 2467afa)
@jpmckinney
jpmckinney merged commit 624732e into 1.2-dev Oct 9, 2026
14 of 15 checks passed
@jpmckinney
jpmckinney deleted the versions-json branch October 9, 2026 00:51
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