Skip to content

Commit fb81bcb

Browse files
p1c2uclaude
andcommitted
Add docs theme override, manifest, and Pagefind pipeline for python-openapi.org
Adds the publishing-pipeline pieces required by the unified python-openapi.org website shell: - docs/overrides/main.html: MkDocs theme override that injects the shared ecosystem banner and footer per docs-theme-contract.md - mkdocs.yml: theme.custom_dir wired to docs/overrides - docs/manifest.json: the manifest the shell consumes to resolve versions and the Pagefind bundle URL - Makefile: docs-pagefind, docs-manifest, and docs-publish targets used by the docs publishing pipeline - .readthedocs.yaml: post_build hook that runs `make docs-publish` and copies docs_build/* into the RTD output, so each published build also exposes /pagefind/ and /manifest.json next to the HTML Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c9bde48 commit fb81bcb

4 files changed

Lines changed: 53 additions & 11 deletions

File tree

.readthedocs.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Read the Docs configuration file
2-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
3+
#
4+
# Pipeline: builds the docs (MkDocs Material), then runs Pagefind over the
5+
# output and copies docs/manifest.json next to it. The published artifact is
6+
# consumed by the python-openapi.org website shell, which proxies docs paths
7+
# from the shell origin to RTD and merges the per-project Pagefind bundles
8+
# in the browser at search time. See ../web/specs/001-openapi-website for
9+
# the website plan and the docs-theme-contract.md.
310
version: 2
411

5-
# Build documentation with Mkdocs
612
mkdocs:
7-
configuration: mkdocs.yml
13+
configuration: mkdocs.yml
814

9-
# Optionally build your docs in additional formats such as PDF and ePub
10-
formats: all
15+
# HTML only — the website shell consumes HTML + manifest + Pagefind. PDF/ePub
16+
# builds are not supported by the current MkDocs plugin set.
17+
formats: []
1118

1219
build:
1320
os: ubuntu-24.04
@@ -21,6 +28,11 @@ build:
2128
- asdf global poetry 2.2.1
2229
post_install:
2330
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --no-interaction --with docs
31+
# Replaces RTD's declarative MkDocs output: `make docs-publish` rebuilds
32+
# the docs into docs_build/, runs Pagefind into docs_build/pagefind/, and
33+
# copies docs/manifest.json into docs_build/. We then move docs_build/*
34+
# into $READTHEDOCS_OUTPUT/html/ so the published artifact contains both
35+
# the manifest and the Pagefind bundle expected by the website shell.
2436
post_build:
2537
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry run make docs-publish
2638
- mkdir -p $READTHEDOCS_OUTPUT/html && cp -r docs_build/* $READTHEDOCS_OUTPUT/html/

docs/manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
"channel": "stable",
1717
"isLatestStable": true,
1818
"publicBasePath": "/openapi-core/docs/0.23.1/",
19-
"originUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/",
20-
"sitemapUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/sitemap.xml",
21-
"searchBundleUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/pagefind/",
19+
"originUrl": "https://openapi-core.readthedocs.io/en/latest/",
20+
"sitemapUrl": "https://openapi-core.readthedocs.io/en/latest/sitemap.xml",
21+
"searchBundleUrl": "https://openapi-core.readthedocs.io/en/latest/pagefind/",
2222
"publishedAt": "2026-04-29T00:00:00Z"
2323
},
2424
{
@@ -27,9 +27,9 @@
2727
"channel": "next",
2828
"isLatestStable": false,
2929
"publicBasePath": "/openapi-core/docs/next/",
30-
"originUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/",
31-
"sitemapUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/sitemap.xml",
32-
"searchBundleUrl": "https://openapi-core.readthedocs.io/en/spike-pagefind-smoke/pagefind/",
30+
"originUrl": "https://openapi-core.readthedocs.io/en/latest/",
31+
"sitemapUrl": "https://openapi-core.readthedocs.io/en/latest/sitemap.xml",
32+
"searchBundleUrl": "https://openapi-core.readthedocs.io/en/latest/pagefind/",
3333
"publishedAt": "2026-04-29T00:00:00Z"
3434
}
3535
]

docs/overrides/main.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% extends "base.html" %}
2+
3+
{#
4+
Shell-aware override for the Python OpenAPI website.
5+
Theme contract: docs-theme-contract.md (themeContractVersion 1).
6+
#}
7+
8+
{% block site_meta %}
9+
{{ super() }}
10+
<meta name="ecosystem-shell" content="Python OpenAPI Ecosystem" />
11+
<meta name="ecosystem-project" content="openapi-core" />
12+
<meta data-theme-contract-version="1" />
13+
{% endblock %}
14+
15+
{% block announce %}
16+
<aside class="ecosystem-shell-banner" aria-label="Python OpenAPI Ecosystem">
17+
<a class="ecosystem-home" href="/" data-ecosystem-home="true">
18+
← Back to the Python OpenAPI
19+
</a>
20+
<span class="ecosystem-project-label" aria-current="page">openapi-core</span>
21+
</aside>
22+
{% endblock %}
23+
24+
{% block footer %}
25+
{{ super() }}
26+
<p class="ecosystem-footer-note" data-theme-contract-version="1">
27+
Part of the <a href="/" class="ecosystem-home">Python OpenAPI Ecosystem</a>.
28+
</p>
29+
{% endblock %}

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_description: OpenAPI for Python
33
site_url: https://openapi-core.readthedocs.io/
44
theme:
55
name: material
6+
custom_dir: docs/overrides
67
icon:
78
repo: fontawesome/brands/github-alt
89
palette:

0 commit comments

Comments
 (0)