diff --git a/layouts/_partials/spec-content.html b/layouts/_partials/spec-content.html index 7f18c60a..23e5a807 100644 --- a/layouts/_partials/spec-content.html +++ b/layouts/_partials/spec-content.html @@ -3,9 +3,12 @@
{{ . | markdownify }}
{{ end }} + {{/* + Render an endpoints table of contents. This is the main difference + between our templates (which call the spec-content partial) and the default + Docsy template. + */}} {{ partial "endpoints-toc.html" . }} {{ .Content }} - - {{ partial "page-meta-lastmod.html" . }} - + \ No newline at end of file diff --git a/layouts/_shortcodes/http-api.html b/layouts/_shortcodes/http-api.html index 109465a1..a5268323 100644 --- a/layouts/_shortcodes/http-api.html +++ b/layouts/_shortcodes/http-api.html @@ -23,11 +23,18 @@ {{ $api := .Params.api}} {{ $anchor_base := .Params.anchor_base}} -{{/* Allow an outer page to collect endpoints (used for modules). */}} +{{/* + + Figure out which Page object to pass to the `openapi/render-api` partial. + Either our own, or one stored under `endpoint_page` in the Scratch, if one + exists. + +*/}} {{ $target_page := .Page }} {{ with .Page.Scratch.Get "endpoint_page" }} {{ $target_page = . }} {{ end }} + {{ $module_name := .Page.Scratch.Get "endpoint_module" }} {{ $api_data := index .Site.Data.api .Params.spec .Params.api }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html index 25449816..6bd0dcb5 100644 --- a/layouts/docs/list.html +++ b/layouts/docs/list.html @@ -1,14 +1,19 @@ {{/* - A simplified version of the list.html partial in Docsy. + Override the `layouts/docs/list.html` template from Docsy. While this template + is equivalent to `single.html`, it's necessary to override both templates to + avoid falling back to the default Docsy templates. + + https://gohugo.io/templates/types/#list + + We use this list template to render the Client-Server API spec page and each + of its modules. + + The contents of the "main" block below are inserted into the `./baseof.html` + base template. */}} {{ define "main" }} -{{ . | markdownify }}
{{ end }} - {{ partial "endpoints-toc.html" . }} - {{ .Content }} -