Display "(deprecated)" next to deprecated endpoints

This commit is contained in:
Andrew Morgan 2025-12-05 14:53:10 +00:00
parent 1213f81676
commit 17acd978a4
3 changed files with 8 additions and 1 deletions

View file

@ -289,6 +289,12 @@ Custom SCSS for the Matrix spec
font-family: $font-family-monospace;
color: $secondary;
}
.endpoint-deprecated {
color: $danger;
font-weight: $font-weight-bold;
margin-left: 0.35rem;
}
}
.page-description {

View file

@ -19,6 +19,7 @@
<a href="#{{ .anchor }}">
<span class="http-api-method">{{ .method }}</span>
<span class="endpoint-path">{{ .endpoint }}</span>
{{ if .deprecated }}<span class="endpoint-deprecated">(deprecated)</span>{{ end }}
</a>
</li>
{{ end }}

View file

@ -32,8 +32,8 @@
{{/* Collect endpoints for the on-page endpoints TOC */}}
{{ if $page }}
{{ $entry := dict "anchor" $anchor "method" $method "endpoint" $endpoint "summary" $operation_data.summary }}
{{/* Store each endpoint's metadata in a scratch variable */}}
{{ $entry := dict "anchor" $anchor "method" $method "endpoint" $endpoint "summary" $operation_data.summary "deprecated" $operation_data.deprecated }}
{{ if not (reflect.IsSlice ($page.Scratch.Get "api_endpoints")) }}
{{ $page.Scratch.Set "api_endpoints" (slice) }}
{{ end }}