Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project docs left sidebar #264

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 16 additions & 36 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,26 @@
[[docs]]
[[external]]
name = "Cosign"
weight = 20
identifier = "cosign"
url = "/docs/cosign/"

[[docs]]
name = "About"
weight = 10
identifier = "about"
url = "/docs/about/"
identifier = "cosign"
url = "https://github.com/sigstore/cosign/tree/main/doc"

[[docs]]
name = "Policy Controller"
weight = 30
identifier = "policy-controller"
url = "/docs/policy-controller/"
[[external]]
name = "Fulcio"
weight = 20
identifier = "fulcio"
url = "https://github.com/sigstore/fulcio/tree/main/docs"

[[docs]]
[[external]]
name = "Gitsign"
weight = 40
weight = 30
identifier = "gitsign"
url = "/docs/gitsign/"

[[docs]]
name = "Rekor"
weight = 50
identifier = "rekor"
url = "/docs/rekor/"

[[docs]]
name = "Get Involved"
weight = 60
identifier = "get_involved"
url = "/docs/get_involved/"

[[docs]]
name = "Help"
weight = 70
identifier = "help"
url = "/docs/help/"

url = "https://github.com/sigstore/gitsign/tree/main/docs"

[[external]]
name = "Policy Controller"
weight = 40
identifier = "policy-controller"
url = "https://github.com/sigstore/policy-controller/blob/main/docs/api-types/index.md"

# [[main]]
# name = "Docs"
Expand Down
16 changes: 15 additions & 1 deletion layouts/partials/sidebar/auto-collapsible-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@
<ul class="list-unstyled collapsible-sidebar">
{{ $currentPage := . -}}

{{ $ExternalDocsPages := slice }}

{{- range site.Menus.external }}

{{ $NewPage := dict "Title" .Name "Permalink" .ConfiguredURL }}
{{ $ExternalDocsPages = $ExternalDocsPages | append $NewPage }}

{{ end }}

{{ $ExternalSiteSection := dict "Title" "Project Documentation" "Pages" $ExternalDocsPages }}

{{ $Sections := site.Sections | append $ExternalSiteSection }}


<!-- This changed from Doks default to reflect no "docs" section folder -->
{{ range site.Sections }}
{{ range $Sections }}
{{ $active := in $currentPage.RelPermalink .RelPermalink }}
<li class="mb-1">
<button class="btn btn-toggle align-items-center rounded collapsed" data-bs-toggle="collapse" data-bs-target="#section-{{ md5 .Title }}" aria-expanded="{{ if $active }}true{{ else }}false{{ end }}">
Expand Down