Skip to content

Commit

Permalink
Add link to Swagger docs to main menu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
cmurphy committed Dec 27, 2023
1 parent 1110d77 commit 840e4a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
9 changes: 9 additions & 0 deletions layouts/partials/sidebar/auto-collapsible-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}


<!-- This changed from Doks default to reflect no "docs" section folder -->
{{ range $Sections }}
Expand Down

0 comments on commit 840e4a0

Please sign in to comment.