Skip to content

Commit

Permalink
Merge pull request #13 from CIDgravity/add-api-link-in-navbar
Browse files Browse the repository at this point in the history
feat: add API documentation link in navbar
  • Loading branch information
FlorianRuen authored Dec 5, 2023
2 parents 8a98b24 + 4fdf4f3 commit 74e1ac1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
name = "Storage providers"
url = "/storage-providers/get-started/claim-a-miner/"
weight = 100
external = false

[[main]]
name = "Reference"
url = "/reference"
weight = 300
external = false

[[main]]
name = "API"
url = "https://service.cidgravity.com/docs"
weight = 500
external = true

[[storage-providers]]
name = "Get started"
Expand Down
12 changes: 10 additions & 2 deletions layouts/partials/header/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,22 @@ <h2 class="h5 offcanvas-title ps-2" id="offcanvasDoksLabel"><a class="text-dark"
{{ range .Children -}}
{{- $active = eq .Name $current.Title -}}
<li>
<a class="dropdown-item{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}"{{ if $active }} aria-current="true"{{ end }}>{{ .Name }}</a>
{{ if eq .Name "API" }}
<a class="dropdown-item{{ if $active }} active{{ end }}" target="_blank" href="{{ .URL | relLangURL }}"{{ if $active }} aria-current="true"{{ end }}>{{ .Name }}</a>
{{ else }}
<a class="dropdown-item{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}"{{ if $active }} aria-current="true"{{ end }}>{{ .Name }}</a>
{{ end -}}
</li>
{{ end -}}
</ul>
</li>
{{ else }}
<li class="nav-item">
<a class="nav-link ps-0 py-1{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ if eq .Name "API" }}
<a class="nav-link ps-0 py-1{{ if $active }} active{{ end }}" target="_blank" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ else }}
<a class="nav-link ps-0 py-1{{ if $active }} active{{ end }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end -}}
</li>
{{ end }}
{{ end -}}
Expand Down

0 comments on commit 74e1ac1

Please sign in to comment.