Place the endpoints list just under the description of each API

We needed to override Docsy's default page renderers to show it. Because
the Client-Server API uses a different render chain than the other
endpoint pages, we have to override two of Docsy's pages (`content.html` and `single.html`).

In order to reduce duplication, we then put the shared content into a
`spec-content.html` partial.
This commit is contained in:
Andrew Morgan 2025-12-05 15:46:03 +00:00
parent 56d48eb3a8
commit f03730455d
3 changed files with 15 additions and 4 deletions

View file

@ -0,0 +1,9 @@
{{- /* Shared render for spec pages: title, optional description, endpoints list, body, and last-mod info. */ -}}
<div class="td-content">
<h1>{{ .Title }}</h1>
{{ partial "endpoints-toc.html" . }}
{{ .Content }}
{{ partial "page-meta-lastmod.html" . }}
</div>

View file

@ -1,4 +1,3 @@
<div class="td-content">
<h1>{{ .Title }}</h1>
{{ .Content }}
</div>
{{ define "main" }}
{{ partial "spec-content.html" . }}
{{ end }}

3
layouts/docs/single.html Normal file
View file

@ -0,0 +1,3 @@
{{ define "main" }}
{{ partial "spec-content.html" . }}
{{ end }}