dot-hugo/layouts/partials/default.html

110 lines
4.3 KiB
HTML
Raw Normal View History

2019-09-04 11:35:48 +00:00
{{ "<!-- details page -->" | safeHTML }}
2020-04-15 03:53:46 +00:00
<section class="single section-sm pb-0">
2019-09-04 11:35:48 +00:00
<div class="container">
<div class="row">
<div class="col-lg-3">
2020-07-05 03:49:50 +00:00
<div class="sidebar">
2021-04-23 20:42:04 +00:00
<a class="back-btn" href="{{ .Site.BaseURL | relLangURL }}" aria-label="back"></a>
2019-09-04 11:35:48 +00:00
<ul class="list-styled">
{{ $currentNode := . }}
{{range .Site.Home.Sections.ByWeight}}
2020-07-05 03:49:50 +00:00
{{ if eq .FirstSection $currentNode.FirstSection }}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode}}
{{ end }}
{{ end }}
{{ if .Content }}
<div>
<button class="btn btn-primary btn-block" id="generatePDF" > Get Pdf </button>
</div>
{{ end }}
2019-09-04 11:35:48 +00:00
</ul>
</div>
</div>
<div class="col-lg-9">
<div class="p-lg-5 p-4 bg-white" id="content">
<h2 class="mb-5" id="title">{{ .Title }}</h2>
2019-09-04 11:35:48 +00:00
{{ if .Content }}
<div class="content">{{.Content}}</div>
{{ else }}
<div class="bg-light p-4">
2019-09-04 11:35:48 +00:00
<ul class="page-list">
2020-02-03 10:30:12 +00:00
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
2019-09-04 11:35:48 +00:00
</ul>
</div>
{{ end }}
<p class="post-meta border-bottom pb-3 mb-0 mt-3">Updated on {{ .Lastmod.Format "02 Jan 2006" }}</p>
2019-09-04 11:35:48 +00:00
<nav class="pagination mt-3">
<!-- Next prev page -->
{{ $currentNode := . }}
{{ template "menu-nextprev" dict "menu" .Site.Home "currentnode" $currentNode }}
{{ define "menu-nextprev" }}
{{$currentNode := .currentnode }}
{{ if ne .menu.Params.hidden true}}
2019-12-30 10:27:38 +00:00
{{if hasPrefix $currentNode.Permalink .menu.Permalink }}
2019-09-04 11:35:48 +00:00
{{ $currentNode.Scratch.Set "NextPageOK" "OK" }}
{{ $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") }}
{{else}}
{{if eq ($currentNode.Scratch.Get "NextPageOK") "OK"}}
{{ $currentNode.Scratch.Set "NextPageOK" nil }}
{{ $currentNode.Scratch.Set "nextPage" .menu }}
{{end}}
{{end}}
{{ $currentNode.Scratch.Set "prevPageTmp" .menu }}
{{ $currentNode.Scratch.Set "pages" .menu.Pages }}
{{ if .menu.IsHome}}
{{ $currentNode.Scratch.Set "pages" .menu.Sections }}
{{ else if .menu.Sections}}
{{ $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) }}
{{end}}
{{ $pages := ($currentNode.Scratch.Get "pages") }}
{{ range $pages.ByWeight }}
{{ template "menu-nextprev" dict "menu" . "currentnode" $currentNode }}
{{end}}
{{ end }}
{{ end }}
{{with ($.Scratch.Get "prevPage")}}
2021-04-23 20:42:04 +00:00
<a class="nav nav-prev" href="{{.Permalink }}" aria-label="Previous page" ><i class="ti-arrow-left mr-2"></i> <span class="d-none d-md-block">{{.Title}}</span></a>
2019-09-04 11:35:48 +00:00
{{end}}
{{with ($.Scratch.Get "nextPage")}}
2021-04-23 20:42:04 +00:00
<a class="nav nav-next" href="{{.Permalink }}" aria-label="Previous page" > <span class="d-none d-md-block">{{.Title}}</span><i class="ti-arrow-right ml-2"></i></a>
2019-09-04 11:35:48 +00:00
{{end}}
</nav>
</div>
</div>
</div>
</div>
</section>
{{ "<!-- /details page -->" | safeHTML }}
<!-- templates -->
{{ define "section-tree-nav" }}
{{ $showvisitedlinks := .showvisitedlinks }}
{{ $currentNode := .currentnode }}
{{with .sect}}
{{safeHTML .Params.head}}
{{ $fileUniqueID := "" }}
{{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }}
{{ $currentNodeFileUniqueID := "" }}
{{ with $currentNode.File }}{{ $currentNodeFileUniqueID = .UniqueID }}{{ end }}
2019-12-30 10:27:38 +00:00
<li data-nav-id="{{.Permalink}}" title="{{.Title}}" class="sidelist
{{if eq $fileUniqueID $currentNodeFileUniqueID}}active{{end}}">
2019-12-30 10:27:38 +00:00
<a href="{{.Permalink}}">
2019-09-04 11:35:48 +00:00
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
</a>
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{ if ne $numberOfPages 0 }}
<ul>
{{ range .Pages.ByWeight }}
{{ if and .Params.hidden (not $.showhidden) }}
{{else}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
{{end}}
{{end}}
</ul>
{{ end }}
2019-09-04 11:35:48 +00:00
</li>
{{ end }}
2020-03-19 09:29:54 +00:00
{{ end }}