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

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvjeantet <valere.jeantet@gmail.com>2020-09-01 23:55:55 +0300
committervjeantet <valere.jeantet@gmail.com>2020-09-01 23:55:55 +0300
commit8446cabd7795977f00bb97fd34e9eec310d5c8ea (patch)
treed38c69225901147be82304a172f06cce148afb86 /layouts/partials
parentd598847437462e482aeb77ae8af4e93ee15dc9cb (diff)
refactor hide_nav, header, breadcrumb...
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/body-article-content.html163
-rw-r--r--layouts/partials/body-header.html2
2 files changed, 83 insertions, 82 deletions
diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html
index fd35861..70d5219 100644
--- a/layouts/partials/body-article-content.html
+++ b/layouts/partials/body-article-content.html
@@ -1,91 +1,90 @@
-{{if not .IsHome}}
- <!-- FIL D'ARIANE -->
- {{if not .Params.layout }}
- <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 }}
-
+ <!-- FIL D'ARIANE -->
+ {{if not .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}}
- <h1>{{.Title}}</h1>
+ <!-- section has no subpage and is not subpage -->
{{end}}
- <!-- FIN TITRE -->
- <!-- JUMP TO SECTION -->
- <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') ? 'material-icons expand_more' : 'material-icons chevron_right';});});">
- {{ T "jump-to-section"}}
- <i style=";" class="material-icons chevron_right"></i>
- </span>
- {{ .TableOfContents }}
- </div>
- <!-- / JUMP TO SECTION -->
+ {{ 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 }}
-
-
-{{end}}
- <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>
-
-
- <div class="chevrons {{.Params.layout}}">
- {{ partial "_next-prev-page.html" .CurrentSection }}
- </div>
+ {{else}}
+ <h1>{{.Title}}</h1>
+ {{end}}
+ <!-- FIN TITRE -->
+
+ <!-- JUMP TO SECTION -->
+ {{if not .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') ? 'material-icons expand_more' : 'material-icons chevron_right';});});">
+ {{ T "jump-to-section"}}
+ <i style=";" class="material-icons 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 .Params.hide_nextpage}}
+ <div class="chevrons {{.Params.layout}}">
+ {{ partial "_next-prev-page.html" .CurrentSection }}
+ </div>
+ {{end -}}
diff --git a/layouts/partials/body-header.html b/layouts/partials/body-header.html
index 531f3f1..97893a7 100644
--- a/layouts/partials/body-header.html
+++ b/layouts/partials/body-header.html
@@ -1,7 +1,9 @@
<div>
+ {{if not .Params.hide_nav}}
<div class="burger {{.Params.layout }}">
<a href="javascript:void(0);" style="font-size:15px;" onclick="$('article > aside').toggleClass('responsive')">&#9776;</a>
</div>
+ {{end}}
<div>
{{- $defaultheader := printf "<a class='baselink' href='%s'>%s</a>" .Site.BaseURL .Site.Title -}}