Skip to content

Commit

Permalink
updated doc version switching link intelops#29
Browse files Browse the repository at this point in the history
  • Loading branch information
tfsojon committed May 16, 2023
1 parent 21ed7d4 commit e21b08b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions themes/godocs-4/layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@

<ul class="dropdown-menu dropdown-menu-right shadow rounded-1 border-0">
{{ $versionLength := len $version }}
{{ $theURL := .RelPermalink }}
{{ $theURL = replaceRE "^/[^/]+" "$1" $theURL }}
{{ range $i, $e := $version }}

{{ if eq $i 0 }}
<li><a class="dropdown-item inactive {{if $isHome}}active{{end}}" id="{{.Params.version}}" aria-current="true" href="{{ .Params.version | relLangURL }}/">
<li><a class="dropdown-item inactive {{if $isHome}}active{{end}}" id="{{.Params.version}}" aria-current="true" href="{{ .Params.version | relLangURL }}{{$theURL}}">
Latest (v{{ .Params.version }})
</a></li>
{{ end }}

{{ if and $i (gt $i 0) }}
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item inactive" id="{{.Params.version}}" href="{{.Params.version | relLangURL}}/">v{{.Params.version}}</a></li>
<li><a class="dropdown-item inactive" id="{{.Params.version}}" href="{{.Params.version | relLangURL}}{{$theURL}}">v{{.Params.version}}</a></li>
{{ end }}

{{ end }}
Expand Down

0 comments on commit e21b08b

Please sign in to comment.