add anchor links to api headers

This commit is contained in:
Ash Keel 2023-03-01 10:17:53 +01:00
parent 8542bdcd3c
commit a0be4496da
No known key found for this signature in database
GPG Key ID: BAD8D93E7314ED3E
1 changed files with 7 additions and 2 deletions

View File

@ -61,7 +61,9 @@
<ul>
{{ range $key, $spec := $keys }}
<li>
<a href="#{{ anchorize $key }}" class="monotitle">{{ $key }}</a>
<a href="#{{ anchorize $key | safeURL }}" class="monotitle"
>{{ $key }}</a
>
</li>
{{ end }}
</ul>
@ -70,9 +72,12 @@
<section class="copy">{{ .Content }}</section>
<section class="reference">
{{ range $key, $spec := $keys }}
<article class="api" id="{{ anchorize $key }}">
<article class="api" id="{{ anchorize $key | safeURL }}">
<header>
<h3>
<a href="#{{ anchorize $key | safeURL }}" class="heading-anchor"
>#</a
>
<span class="monotitle">{{ $key }}</span> {{ range .tags }}
<span class="tag {{ . }}">{{ . }}</span>
{{ end }}