From 17acd978a40d1f26729782a61c810dbbef672663 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 5 Dec 2025 14:53:10 +0000 Subject: [PATCH] Display "(deprecated)" next to deprecated endpoints --- assets/scss/_styles_project.scss | 6 ++++++ layouts/_partials/endpoints-toc.html | 1 + layouts/_partials/openapi/render-operation.html | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/scss/_styles_project.scss b/assets/scss/_styles_project.scss index 71686e54..2e1d2da9 100644 --- a/assets/scss/_styles_project.scss +++ b/assets/scss/_styles_project.scss @@ -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 { diff --git a/layouts/_partials/endpoints-toc.html b/layouts/_partials/endpoints-toc.html index 238dee05..f2ccae3b 100644 --- a/layouts/_partials/endpoints-toc.html +++ b/layouts/_partials/endpoints-toc.html @@ -19,6 +19,7 @@ {{ .method }} {{ .endpoint }} + {{ if .deprecated }}(deprecated){{ end }} {{ end }} diff --git a/layouts/_partials/openapi/render-operation.html b/layouts/_partials/openapi/render-operation.html index d59ea16d..dbfdf346 100644 --- a/layouts/_partials/openapi/render-operation.html +++ b/layouts/_partials/openapi/render-operation.html @@ -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 }}