mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-25 20:14:09 +02:00
Compare commits
3 commits
527dc7709e
...
1a8db7966c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a8db7966c | ||
|
|
46edb1d240 | ||
|
|
844cf0aa83 |
|
|
@ -7,6 +7,8 @@
|
||||||
of each value in `paths` to get a complete URL.
|
of each value in `paths` to get a complete URL.
|
||||||
* `anchor_base`: an optional prefix for the HTML IDs generated by
|
* `anchor_base`: an optional prefix for the HTML IDs generated by
|
||||||
this template.
|
this template.
|
||||||
|
* `page`: the (Hugo) Page object to store endpoint metadata in the Scratch of. Used to build the endpoints TOC.
|
||||||
|
* `module`: the current CS API module name, if any. Used to group endpoints in the TOC.
|
||||||
|
|
||||||
This template replaces the old {{*_http_api}} template.
|
This template replaces the old {{*_http_api}} template.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
* `operation_data`: the OpenAPI data for the operation
|
* `operation_data`: the OpenAPI data for the operation
|
||||||
* `anchor_base`: an optional prefix for the HTML IDs generated by
|
* `anchor_base`: an optional prefix for the HTML IDs generated by
|
||||||
this template.
|
this template.
|
||||||
|
* `page`: the (Hugo) Page object to store endpoint metadata in the Scratch of. Used to build the endpoints TOC.
|
||||||
|
* `module`: the current CS API module name, if any. Used to group endpoints in the TOC.
|
||||||
|
|
||||||
This template renders the operation as a `<section>` containing:
|
This template renders the operation as a `<section>` containing:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,12 @@
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
{{ with .Params.description }}<p class="page-description">{{ . | markdownify }}</p>{{ end }}
|
{{ with .Params.description }}<p class="page-description">{{ . | markdownify }}</p>{{ 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" . }}
|
{{ partial "endpoints-toc.html" . }}
|
||||||
|
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
</div>
|
||||||
{{ partial "page-meta-lastmod.html" . }}
|
|
||||||
</div>
|
|
||||||
|
|
@ -23,11 +23,18 @@
|
||||||
{{ $api := .Params.api}}
|
{{ $api := .Params.api}}
|
||||||
{{ $anchor_base := .Params.anchor_base}}
|
{{ $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 }}
|
{{ $target_page := .Page }}
|
||||||
{{ with .Page.Scratch.Get "endpoint_page" }}
|
{{ with .Page.Scratch.Get "endpoint_page" }}
|
||||||
{{ $target_page = . }}
|
{{ $target_page = . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ $module_name := .Page.Scratch.Get "endpoint_module" }}
|
{{ $module_name := .Page.Scratch.Get "endpoint_module" }}
|
||||||
|
|
||||||
{{ $api_data := index .Site.Data.api .Params.spec .Params.api }}
|
{{ $api_data := index .Site.Data.api .Params.spec .Params.api }}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
{{ define "main" }}
|
|
||||||
{{ partial "spec-content.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
@ -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" }}
|
{{ define "main" }}
|
||||||
<div class="td-content">
|
{{ partial "spec-content.html" . }}
|
||||||
<h1>{{ .Title }}</h1>
|
|
||||||
{{ with .Params.description }}<p class="page-description">{{ . | markdownify }}</p>{{ end }}
|
|
||||||
{{ partial "endpoints-toc.html" . }}
|
|
||||||
{{ .Content }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,19 @@
|
||||||
|
{{/*
|
||||||
|
|
||||||
|
Override the `layouts/docs/single.html` template from Docsy. While this template
|
||||||
|
is equivalent to `list.html`, it's necessary to override both templates to
|
||||||
|
avoid falling back to the default Docsy templates.
|
||||||
|
|
||||||
|
https://gohugo.io/templates/types/#single
|
||||||
|
|
||||||
|
We use this single template to render the all API spec pages *except* the
|
||||||
|
Client-Server API. The Client-Server API spec page contains modules, and thus
|
||||||
|
is handled separately.
|
||||||
|
|
||||||
|
The contents of the "main" block below are inserted into the `./baseof.html`
|
||||||
|
base template.
|
||||||
|
|
||||||
|
*/}}
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ partial "spec-content.html" . }}
|
{{ partial "spec-content.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
Loading…
Reference in a new issue