layout: swagger passthrough for interactive API reference#407
Merged
Conversation
Add layouts/swagger/single.html, a raw-passthrough layout that emits the api.html page resource verbatim (no baseof, so no theme chrome). Pages of type: swagger under docs/platform/<version>/api/reference/ render the self-contained Swagger UI generated from the platform OpenAPI spec. Companion to the docs repo change that ships api.html into the versioned tree. Signed-off-by: Tamal Saha <tamal@appscode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
layouts/swagger/single.html, a one-line raw-passthrough layout:Pages with
type: swaggeremit their bundledapi.htmlresource verbatim. Because the template has no{{ define "main" }}block, Hugo skipsbaseof.html, so no header/footer/sidebar wraps the standalone Swagger UI.Why
The KubeDB Platform docs ship a self-contained, per-version Swagger UI page (
api.html, spec inlined) generated from the platform OpenAPI spec. A.htmlfile dropped intocontent/gets rendered as a wrapped page at the wrong URL; as a plain resource Hugo won't publish it. This layout is the mechanism that serves it byte-for-byte at/docs/platform/<version>/api/reference/.Follows the existing
layouts/<type>/single.htmloverride pattern (e.g.layouts/products/single.html) — no theme change.Companion
Requires the docs repo change that ships
api.htmlinto the versioned tree: appscode-cloud/docs#144. Land this first so the layout exists when docs first aggregate.Verification
Built the full site with the real
hugo-product-theme(Hugo 0.128.2): the page renders atdocs/platform/v2026.7.10/api/reference/index.html, byte-identical (cmp) to sourceapi.html, no theme chrome.