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

sidebar.html « partials « layouts - github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5d8970c37608e949b31150486e6bb4c6b322362b (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
{{ $s := site.Params }}
<aside class="sidebar">
  <section class="sidebar_inner">
    <br>
    {{ partial "search/widget" . }}
    {{- $introDescription := $s.introDescription }}
    {{- with .Params.introDescription }}
      {{- $introDescription = . }}
    {{- end }}
    {{- if $introDescription }}
      {{- $author := $s.Author  }}
      {{- $showAuthorPhoto := false }}
      {{- $fullAuthor := reflect.IsMap $author }}
      {{- if $fullAuthor }}
        {{-  if $author.photo }}
          {{- $showAuthorPhoto = true }}
        {{- end }}
      {{- end }}
      {{- if $showAuthorPhoto }}
        <div class="author_header">
          <img src="{{ absURL $author.photo }}" alt="{{ $author.name }} photo">
          <h2>{{  $author.name }}</h2>
        </div>
      {{- else }}
        <h2>{{  if $fullAuthor }}{{ $author.name }}{{ else }}{{ $author }}{{ end }}</h2>
      {{- end }}
      <div class="author_bio">
        {{ markdownify $introDescription }}
      </div>
      {{- if ( ne $s.introURL false ) }}
      {{- $r := T "read_more" }}
      <a href='{{ absLangURL (default "about/" $s.introURL) }}' class="button mt-1" role="button" title='{{ $r }}'>{{ $r }}</a>
      {{- end }}
    {{- end }}

    {{ if .Site.Params.sidebardisclaimer }}
      <div class="sidebardisclaimer">
        <h2 class="mt-4">Disclaimer</h2>
        {{ .Site.Params.disclaimerText }}
      </div>
    {{ end }}

    {{- $relatedInSidebar := true }}
    {{- if eq $s.showRelatedInSidebar false }}
      {{ $relatedInSidebar = false }}
    {{- end }}
    {{ if (and ($relatedInSidebar) (isset .Params "series") ) }}
      {{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
	    <h2 class="mt-4">{{ T "series_posts" }}</h2>
      <ul>
        {{ range $related }}
        <li>
          <a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
        </li>
        {{ end }}
      </ul>
    {{ end }}

    {{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.mainSections }}
    {{- $featured := default 8 $s.numberOfFeaturedPosts }}
    {{- $featured_posts := first $featured (where $posts "Params.featured" true)}}
    {{- with $featured_posts }}
    <h2 class="mt-4">{{ T "featured_posts" }}</h2>
    <ul>
      {{- range . }}
      <li>
        <a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
      </li>
      {{- end }}
    </ul>
    {{- end }}
    <h2 class="mt-4">{{ T "recent_posts" }}</h2>
    <ul class="flex-column">
      {{- $recent := default 8 $s.numberOfRecentPosts }}
      {{- range first $recent $posts | symdiff $featured_posts }}
      <li>
        <a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title | markdownify }}</a>
      </li>
      {{- end }}
    </ul>
    {{- $tagsLimit := (default 100 $s.numberOfTagsShown) }}
    {{- range $key, $value := .Site.Taxonomies }}
    {{- if gt $value 0 }}
    <div>
      <h2 class="mt-4 taxonomy" id="{{ $key }}-section">{{ T $key }}</h2>
      <nav class="tags_nav">
        {{- $onPageTags := $.Page.Params.tags }}
        {{- $slicedTags := ($value.ByCount | first $tagsLimit) }}
        {{- range $slicedTags }}
        <a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class="post_tag button button_translucent" title="{{ .Name }}">
          {{ upper .Name }}
          <span class="button_tally">{{ .Count }}</span>
        </a>
        {{ end }}
        {{ if gt (len $value.ByCount) $tagsLimit }}
        <br>
        <div class="post_tags_toggle button">{{ T (printf "all_%s" (lower $key)) }}</div>
        {{- $tagsInfo := newScratch }}
        <div class="post_tags">
          <div class="tags_list">
            {{- range $value.Alphabetical }}
            {{ $tagsInfo.Add "tagsInfo" (slice .Name .Count)}}
            <a href='{{ absLangURL $key }}/{{ (replace .Name "#" "%23") | urlize }}/' class=" post_tag button button_translucent" data-position={{ .Count }} title="{{ .Name }}">
              {{- upper .Name -}}
              <span class="button_tally">{{ .Count }}</span>
            </a>
            {{ end }}
            <div class="tags_sort"><span title="sort alphabetically">[A~Z]</span><span title="sort by count">[0~9]</span>
            </div>
            <span class="tags_hide"><svg class="icon">
            <use xlink:href="#closeme"></use>
          </svg></span>
          </div>
        </div>
        {{- end }}
      </nav>
    </div>
    {{- end }}
    {{- end }}
  </section>
</aside>