Skip to content

Commit a7ec82f

Browse files
committed
Pagefind smoke
1 parent 8bcc770 commit a7ec82f

3 files changed

Lines changed: 71 additions & 1 deletion

File tree

.readthedocs.yaml

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

312
sphinx:
413
configuration: docs/conf.py
514

6-
formats: all
15+
# HTML only — the website shell consumes HTML + manifest + Pagefind. PDF/ePub
16+
# builds are not needed for the integration.
17+
formats: []
718

819
build:
920
os: ubuntu-24.04
1021
tools:
1122
python: "3.14"
23+
nodejs: "20"
1224
jobs:
1325
post_install:
1426
- pip install poetry
1527
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
28+
# Replaces RTD's declarative Sphinx output: `make docs-publish` rebuilds
29+
# the docs into docs/_build/html/, runs Pagefind over it, and copies
30+
# docs/manifest.json next to the HTML. We then move docs/_build/html/*
31+
# into $READTHEDOCS_OUTPUT/html/ so the published artifact contains both
32+
# the manifest and the Pagefind bundle expected by the website shell.
33+
post_build:
34+
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry run make docs-publish
35+
- mkdir -p $READTHEDOCS_OUTPUT/html && cp -r docs/_build/html/* $READTHEDOCS_OUTPUT/html/

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ test-cleanup: test-cache-cleanup reports-cleanup
3535

3636
cleanup: dist-cleanup test-cleanup
3737

38+
docs-html:
39+
sphinx-build -b html docs docs/_build/html
40+
41+
docs-pagefind: docs-html
42+
@npx --yes pagefind --site docs/_build/html
43+
44+
docs-manifest:
45+
@cp docs/manifest.json docs/_build/html/manifest.json
46+
47+
docs-publish: docs-html docs-pagefind docs-manifest
48+
49+
docs-cleanup:
50+
@rm -rf docs/_build
51+
3852
docker-build:
3953
@docker build --no-cache --build-arg OPENAPI_SPEC_VALIDATOR_VERSION=${VERSION} -t ${PROJECT_NAME}:${VERSION} .
4054

docs/manifest.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"manifestVersion": 1,
3+
"projectSlug": "openapi-spec-validator",
4+
"displayName": "openapi-spec-validator",
5+
"themeContractVersion": 1,
6+
"latestStableVersion": "0.7.2",
7+
"routes": {
8+
"publicProjectPath": "/openapi-spec-validator",
9+
"latestDocsPath": "/openapi-spec-validator/docs/",
10+
"versionedDocsPrefix": "/openapi-spec-validator/docs/"
11+
},
12+
"versions": [
13+
{
14+
"version": "0.7.2",
15+
"label": "0.7.2",
16+
"channel": "stable",
17+
"isLatestStable": true,
18+
"publicBasePath": "/openapi-spec-validator/docs/0.7.2/",
19+
"originUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/",
20+
"sitemapUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/sitemap.xml",
21+
"searchBundleUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/pagefind/",
22+
"publishedAt": "2026-04-29T00:00:00Z"
23+
},
24+
{
25+
"version": "next",
26+
"label": "next",
27+
"channel": "next",
28+
"isLatestStable": false,
29+
"publicBasePath": "/openapi-spec-validator/docs/next/",
30+
"originUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/",
31+
"sitemapUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/sitemap.xml",
32+
"searchBundleUrl": "https://openapi-spec-validator.readthedocs.io/en/spike-pagefind-smoke/pagefind/",
33+
"publishedAt": "2026-04-29T00:00:00Z"
34+
}
35+
]
36+
}

0 commit comments

Comments
 (0)