|
1 | 1 | <nav class="breadcrumbs"> |
2 | | - <ol class="links" itemscope itemtype="http://schema.org/BreadcrumbList"> |
3 | | - <meta itemprop="itemListOrder" content="Descending" /> |
4 | | - {{ range .Ancestors.Reverse -}} |
| 2 | + <ol class="links" vocab="http://schema.org/" typeof="BreadcrumbList"> |
| 3 | + {{ $position := 0 -}} |
| 4 | + {{ range .Ancestors.Reverse | append . -}} |
5 | 5 | {{ if not .IsHome -}} |
6 | | - <li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"> |
7 | | - <meta itemprop="position" content="{{ .Params.menuTitle | markdownify }}" /> |
8 | | - <a itemprop="item" class="link" href="{{ .RelPermalink }}"> |
9 | | - <span itemprop="name" class="breadcrumb-entry"> |
10 | | - {{ if eq .Path "/arangodb/" -}} |
11 | | - {{ $coreVersion := index (split .Path "/") 2 }} |
12 | | - {{ template "getVersionLong" dict "coreVersion" $coreVersion -}} |
13 | | - {{ else -}} |
14 | | - {{ .Params.menuTitle | markdownify -}} |
15 | | - {{ end -}} |
16 | | - </span> |
17 | | - </a> |
18 | | - <i class="fas fa-chevron-right fa-fw"></i> |
19 | | - </li> |
| 6 | + {{ $position = add $position 1 -}} |
| 7 | + <li typeof="ListItem" property="itemListElement"> |
| 8 | + <meta property="position" content="{{ $position }}" /> |
| 9 | + {{ if gt $position 1 }}<i class="fas fa-chevron-right fa-fw"></i>{{/* TODO <svg style="height: 12px; width: 12px" viewBox="0 0 7 7"><path fill="none" stroke="currentColor" stroke-width="1" d="m 2,6.5 3,-3 -3,-3"></path></svg> */}}{{ end -}} |
| 10 | + <a property="item" class="link" href="{{ .RelPermalink }}">{{/* White-space control */ -}} |
| 11 | + <span property="name" class="breadcrumb-entry"> |
| 12 | + {{- $splitPath := split .Path "/" -}} |
| 13 | + {{ if and (hasPrefix .Path "/arangodb/") (eq ($splitPath | len) 3) -}} |
| 14 | + {{ $coreVersion := index $splitPath 2 -}} |
| 15 | + {{ template "getVersionLong" dict "coreVersion" $coreVersion -}} |
| 16 | + {{ else -}} |
| 17 | + {{ .Params.menuTitle | markdownify -}} |
| 18 | + {{ end -}} |
| 19 | + </span> |
| 20 | + </a> |
| 21 | + </li> |
20 | 22 | {{ end -}} |
21 | | - {{ end -}} |
22 | | - {{ if not .IsHome -}} |
23 | | - <li itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"> |
24 | | - <meta itemprop="position" content="{{ .Params.menuTitle | markdownify }}" /> |
25 | | - <a itemprop="item" class="link" href="{{ .RelPermalink }}"> |
26 | | - <span itemprop="name" class="breadcrumb-entry"> |
27 | | - {{ if eq .Path "/arangodb/" -}} |
28 | | - {{ $coreVersion := index (split .Path "/") 2 }} |
29 | | - {{ template "getVersionLong" dict "coreVersion" $coreVersion -}} |
30 | | - {{ else -}} |
31 | | - {{ .Params.menuTitle | markdownify -}} |
32 | | - {{ end -}} |
33 | | - </span> |
34 | | - </a> |
35 | | - </li> |
36 | 23 | {{ end -}} |
37 | 24 | </ol> |
38 | 25 | </nav> |
|
41 | 28 | {{ $coreVersion := .coreVersion -}} |
42 | 29 | {{ $versions := index site.Data.versions "/arangodb/" -}} |
43 | 30 | {{ range $i, $version := $versions -}} |
44 | | - {{ if eq $coreVersion $version.name -}} |
| 31 | + {{ if or (eq $coreVersion $version.name) (eq $coreVersion $version.alias) -}} |
45 | 32 | {{ $version.version -}} |
| 33 | + {{ break -}} |
46 | 34 | {{ end -}} |
47 | 35 | {{ end -}} |
48 | 36 | {{ end -}} |
0 commit comments