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

next-prev-page.html « partials « layouts - github.com/vantagedesign/ace-documentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ae0f5481ca7032db66e005afb2e375b4878dc499 (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
<div class="bg-primary overflow-hidden p-3 mt-5 shadow">

    <h4 class="text-white text-center">Read more</h4>

    <!-- Next prev page -->
    {{- $currentNode := . -}}

    {{- template "menu-nextprev" dict "menu" .Site.Home "currentnode" $currentNode -}}

    {{- define "menu-nextprev" -}}
        {{- $currentNode := .currentnode -}}
        {{- if ne .menu.Params.hidden true -}}
            {{- if hasPrefix $currentNode.RelPermalink .menu.RelPermalink -}}
                {{- $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 -}}

    <div class="d-flex justify-content-center">
        {{- with ($.Scratch.Get "prevPage") -}}
            <a class="p-1 mr-3 d-inline-block text-white" href="{{.RelPermalink}}" title="{{.Title}}"><i class="fas fa-chevron-left p-1"></i>{{.Title}}</a>
        {{ end -}}
        {{- with ($.Scratch.Get "nextPage") -}}
            <a class="p-1 ml-3 d-inline-block text-white text-right" href="{{.RelPermalink}}" title="{{.Title}}">{{.Title}}<i class="fas fa-chevron-right p-1"></i></a>
        {{- end }}
    </div>
</div>