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

sidebar.html « pages « partials « layouts - github.com/2-REC/hugo-myportfolio-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f5a71e278bdfdc524e2e1d0e0b7c7e204094b198 (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
{{ "<!-- SIDEBAR.HTML -->" | safeHTML }}
<div class="sidebar sticky">
    {{ "<!-- Small Image -->" | safeHTML }}
    {{ if .Params.small_image }}
        {{ $image := .Resources.GetMatch .Params.small_image }}
        {{ with $image }}
            <div class="sidebar-image">
                {{ if $.Params.small_url }}
                <a href="{{ $.Params.small_url | absURL }}" target="_blank">
                {{ end }}
                    {{ $alt := or $.Params.small_url "" }}
                    <img src="{{ .Permalink }}" alt="{{ $alt }}">
                {{ if $.Params.small_url }}
                </a>
                {{ end }}
            </div>
        {{ end }}
    {{ else }}
        <div class="empty-padding"></div>
    {{ end }}

    {{ "<!-- Navigation Tree -->" | safeHTML }}
    <div class="sidebar-tree">
        {{ with .Parent }}
            <a class="parent-link" href="{{ .Permalink }}">
                {{ if not .IsHome }}
                    <i class="fas fa-chevron-circle-left"></i>
                    {{ .Title }}
                {{ else }}
                    <i class="fas fa-home"></i>
                    HOME
                {{ end }}
            </a>
        {{ end }}

        {{ if (or (not (isset .Params "showbrothers")) (.Params.showbrothers)) }}
            {{ if .Parent }}
                {{ if eq .Kind "section" }}
                    {{ partial "utils/ordered-list.html" (dict "list" .Parent.Sections "params" .Parent.Params "scratch" .Scratch) }}
                {{ else }}
                    {{ partial "utils/ordered-list.html" (dict "list" .Parent.Pages "params" .Parent.Params "scratch" .Scratch) }}
                {{ end }}

                {{ $current := . }}
                <ul>
                    {{ range (.Scratch.Get "list") }}
                        {{ if eq $current . }}
                        <li class="active">
                        {{ else }}
                        <li>
                        {{ end }}
                            <a href="{{ .Permalink }}">{{ .Title }}</a>
                        </li>
                    {{ end }}
                </ul>

                {{ .Scratch.Delete "list" }}
            {{ end }}
        {{ end }}
    </div>

    <br>
    {{ "<!-- Categories -->" | safeHTML }}
    <div>
        <div class="tag-title">CATEGORIES</div>
        <div class="tags">
            {{/* List categories without duplicates */}}
            {{ partial "utils/list-keywords.html" (dict "type" "categories" "context" . "scratch" .Scratch "removeDuplicates" true) }}
        </div>
    </div>
    <br>
    {{ "<!-- Tags -->" | safeHTML }}
    <div>
        <div class="tag-title">TAGS</div>
        <div class="tags">
            {{/* List tags without duplicates */}}
            {{ partial "utils/list-keywords.html" (dict "type" "tags" "context" . "scratch" .Scratch "removeDuplicates" true) }}
        </div>
    </div>
</div>