From 37a51c63afa93fdf9505ff5d7508e6f3e1fa0ee0 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 3 Jan 2024 16:15:24 -0800 Subject: [PATCH] Add link to Swagger docs to main menu (#284) The HTTP API reference is not linked through the docs site so it's not clear to a newcomer to Sigstore that one actually exists. This change adds a link on the main menu out to the auto-generated Swagger site so that it is easily discoverable. Signed-off-by: Colleen Murphy --- config/_default/menus/menus.en.toml | 6 ++++++ layouts/partials/sidebar/auto-collapsible-menu.html | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/config/_default/menus/menus.en.toml b/config/_default/menus/menus.en.toml index abac4c3a..dab1b2d0 100644 --- a/config/_default/menus/menus.en.toml +++ b/config/_default/menus/menus.en.toml @@ -22,6 +22,12 @@ identifier = "policy-controller" url = "https://github.com/sigstore/policy-controller/blob/main/docs/api-types/index.md" +[[swagger]] + name = "OpenAPI Specification" + weight = 50 + identifier = "swagger" + url = "https://www.sigstore.dev/swagger/" + # [[main]] # name = "Docs" # url = "/docs/about/overview/" diff --git a/layouts/partials/sidebar/auto-collapsible-menu.html b/layouts/partials/sidebar/auto-collapsible-menu.html index 65b6670c..d15a0894 100644 --- a/layouts/partials/sidebar/auto-collapsible-menu.html +++ b/layouts/partials/sidebar/auto-collapsible-menu.html @@ -15,6 +15,15 @@ {{ $Sections := site.Sections | append $ExternalSiteSection }} + {{ $SwaggerDocsPages := slice }} + {{- range site.Menus.swagger }} + {{ $NewPage := dict "TargetBlank" true "Title" .Name "Permalink" .ConfiguredURL }} + {{ $SwaggerDocsPages = $SwaggerDocsPages | append $NewPage }} + {{ end }} + {{ $SwaggerSection := dict "Title" "API Reference" "Pages" $SwaggerDocsPages }} + + {{ $Sections = $Sections | append $SwaggerSection }} + {{ range $Sections }}