1
1
< nav id ="artikel-navigation ">
2
2
<!-- Find next and previous page -->
3
3
4
- {{ $root := .GetPage "/" }}
4
+ {{- $root := .GetPage "/" - }}
5
5
6
6
<!-- Next -->
7
- {{ $next := .CurrentSection.Pages.Prev . }}
7
+ {{- $next := .CurrentSection.Pages.Prev . - }}
8
8
<!-- Section -> Child -->
9
- {{ if or .IsSection (.Eq $root) }}
10
- {{ $next = index .Pages 0 }}
11
- {{ end }}
12
- {{ if eq $next nil }}
13
- {{ with .CurrentSection.Parent }}
9
+ {{- if or .IsSection (.Eq $root) - }}
10
+ {{- $next = index .Pages 0 - }}
11
+ {{- end - }}
12
+ {{- if eq $next nil - }}
13
+ {{- with .CurrentSection.Parent - }}
14
14
<!-- Beispiele -> Kombinationen -->
15
- {{ with .Pages.Prev $.CurrentSection }}
16
- {{ $next = . }}
15
+ {{- with .Pages.Prev $.CurrentSection - }}
16
+ {{- $next = . - }}
17
17
<!-- Zufall -> Beispielprogramme -->
18
- {{ else }}
19
- {{ $next = .Parent.Pages.Prev . }}
20
- {{ end }}
21
- {{ end }}
22
- {{ end }}
18
+ {{- else - }}
19
+ {{- $next = .Parent.Pages.Prev . - }}
20
+ {{- end - }}
21
+ {{- end - }}
22
+ {{- end - }}
23
23
24
24
<!-- Previous -->
25
- {{ $prev := .CurrentSection.Pages.Next . }}
25
+ {{- $prev := .CurrentSection.Pages.Next . - }}
26
26
<!-- Funktionen -> Verzweigungen -->
27
- {{ if .IsSection }}
28
- {{ $prev = .Parent.Pages.Next . }}
29
- {{ end }}
27
+ {{- if .IsSection - }}
28
+ {{- $prev = .Parent.Pages.Next . - }}
29
+ {{- end - }}
30
30
31
31
<!-- Datentypen -> Programmierung -->
32
- {{ if .Eq (index .CurrentSection.Pages 0) }}
33
- {{ $prev = .CurrentSection }}
32
+ {{- if .Eq (index .CurrentSection.Pages 0) - }}
33
+ {{- $prev = .CurrentSection - }}
34
34
<!-- Kombinationen -> Beispiele -->
35
- {{ else if and $prev $prev.IsSection }}
36
- {{ $prev = index ($prev.Pages | last 1) 0 }}
37
- {{ end }}
35
+ {{- else if and $prev $prev.IsSection - }}
36
+ {{- $prev = index ($prev.Pages | last 1) 0 - }}
37
+ {{- end - }}
38
38
39
- < link rel ="prefetch " href ="{{ with or $prev $root }} {{ .RelPermalink }} {{ end }} " as ="document ">
40
- < link rel ="prefetch " href ="{{ with or $next $root }} {{ .RelPermalink }} {{ end }} " as ="document ">
39
+ < link rel ="prefetch " href ="{{- with or $prev $root - }} {{- .RelPermalink - }} {{- end - }} " as ="document ">
40
+ < link rel ="prefetch " href ="{{- with or $next $root - }} {{- .RelPermalink - }} {{- end - }} " as ="document ">
41
41
42
- < a href ="{{ with or $prev $root }} {{ .RelPermalink }} {{ end }} " title ='{{ T "prev" }} '> <</ a >
43
- < a href ="{{ with or $next $root }} {{ .RelPermalink }} {{ end }} " title ='{{ T "next" }} '> ></ a >
42
+ < a href ="{{- with or $prev $root - }} {{- .RelPermalink - }} {{- end - }} " title ='{{- T "prev" - }} '> <</ a >
43
+ < a href ="{{- with or $next $root - }} {{- .RelPermalink - }} {{- end - }} " title ='{{- T "next" - }} '> ></ a >
44
44
</ nav >
0 commit comments