blob: 71cec065de2e4ebfab0ef20d3d09a86a9e2754de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
<!-- FIL D'ARIANE -->
{{if not (in .Params.hide "breadcrumb")}}
<nav id="breadcrumb" aria-label="breadcrumb">
<ol class="breadcrumb">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
</nav>
{{end}}
<!-- FIN FIL D'ARIANE -->
<!-- TITRE -->
{{if not .Params.layout }}
{{$pagetitle := .Title}}
{{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
{{ $cPage := .}}
{{ $elements := (where .Sections "NONONO" false) }}
{{ $isSubPage := .Params.subpage }}
{{ $subpages := (where (where (where .Sections.ByWeight "Params.subpage" true) "Params.hidden" "ne" true ) "Kind" "section")}}
{{ $pages := (where (where .CurrentSection.Pages.ByWeight "Kind" "page") "Params.hidden" "ne" true ) }}
{{if $isSubPage }}
<h1>{{.Parent.Title}}<span>{{$pagetitle}}</span></h1>
{{else}}
<h1>{{.CurrentSection.Title}}{{if .IsPage }}<span>{{$pagetitle}}</span>{{end}}</h1>
{{end}}
{{if gt (len $subpages) 0}} <!-- section has subpage -->
{{ $elements = $subpages }}
{{else if $isSubPage }} <!-- Section is subpage -->
{{ $elements = (where (where .Parent.Sections.ByWeight "Params.subpage" true) "Params.hidden" "ne" true ) }}
{{else if gt (len $pages) 0}} <!-- Section has pages -->
{{ $elements = $pages }}
{{else}}
<!-- section has no subpage and is not subpage -->
{{end}}
{{ if gt (len $elements) 0}}
<nav class="subpages">
{{- range $elements}}
{{- if not .Params.hidden }}
{{$pagetitle := .Title}}
{{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
<li {{if eq . $cPage}}class="active"{{- end}}>
<a title="$pagetitle" href="{{ .RelPermalink}}">{{safeHTML .Params.Pre}}{{$pagetitle}}{{safeHTML .Params.Post}}</a>
</li>
{{- end}}
{{- end}}
</nav>
{{ end }}
{{else}}
<h1>{{.Title}}</h1>
{{end}}
<!-- FIN TITRE -->
<!-- JUMP TO SECTION -->
{{if not (in .Params.hide "toc")}}
<div class="jump-to-section">
<span onclick="$h = $(this);$h.next('nav').slideToggle(100,function () {$h.children('i').attr('class',function () {return $h.next('nav').is(':visible') ? 'fas fa-chevron-down' : 'fas fa-chevron-right';});});">
{{ T "jump-to-section"}}
<i style=";" class="fas fa-chevron-right"></i>
</span>
{{ .TableOfContents }}
</div>
{{end}}
<!-- / JUMP TO SECTION -->
<div class="content">
{{- with .Content -}}
{{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1}${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
{{- else -}}
{{with index .Pages 0}}
<meta http-equiv = "refresh" content = "0; url = {{.RelPermalink}}"/>
{{- else -}}
No content
{{- end -}}
{{- end -}}
</div>
{{if not (in .Params.hide "nextpage")}}
<div class="chevrons {{.Params.layout}}">
{{ partial "_next-prev-page.html" .CurrentSection }}
</div>
{{end -}}
{{ define "breadcrumbnav" }}
{{ if .p1.Parent }}
{{ if .p1.Parent.IsHome}}
<li class="breadcrumb-item ">
<a class="text-link" href="{{.p1.Site.BaseURL}}">
{{ T "home"}}
</a>
</li>
{{else}}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 ) }}
{{end}}
{{ else if not .p1.IsHome }}
{{ template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
<li class="breadcrumb-item {{ if eq .p1 .p2 }}active{{ end }}">
{{ if ne .p1 .p2 }}<a class="text-link" href="{{ .p1.RelPermalink }}">{{ end }}
{{ .p1.Title }}
{{ if ne .p1 .p2 }}</a>{{ end }}
</li>
{{ end }}
|