Welcome to mirror list, hosted at ThFree Co, Russian Federation.

body-article-content.html « partials « layouts - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 73f2abf7144e19ef0f178acd23938295212dff9b (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
114
115
116
117
118
119
120
121
122
123
124

    <!-- FIL D'ARIANE -->
    {{if not (in .Params.hide "breadcrumb")}}
    <nav id="ariane" aria-label="breadcrumb">
      <ol class="ariane">
        {{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
      </ol>
    </nav>
    {{end}}
    <!-- FIN FIL D'ARIANE -->

    <!-- TITRE -->
		{{$pagetitle := .Title}}
        {{if eq $pagetitle ""}}
        	{{with .File}}{{$pagetitle = .BaseFileName}}{{end}}
        {{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 .File -}}
		            {{- if and (not .Params.hidden) ( not (hasPrefix .File.BaseFileName "__")) }}
	            		{{$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}}  
	        	{{- end}}
	        	</nav> 
		{{ 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';});});">
  			<span class="fas fa-align-right"></span>
  			{{ T "jump-to-section"}}
  			<i style=";" class="fas fa-chevron-right"></i>
		</span>
		{{ .TableOfContents }}
	</div>
	{{end}}
	<!-- / JUMP TO SECTION -->






	<div class="content">
    {{- with .Content -}}
		{{ partial "_checklist-header.html" $ }}
	    {{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1} ref="${2}" ${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
		{{ partial "_checklist-footer.html" $ }}      	
    {{- 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">
		{{ partial "_next-prev-page.html" .CurrentSection }}
	</div>
	{{end -}}

	



{{ define "breadcrumbnav" }}
  {{ if .p1.Parent }}
  	{{ if .p1.Parent.IsHome}}
	<li >
      <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="{{ 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 }}