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

sidebar.html « partials « layouts - github.com/jpescador/hugo-future-imperfect.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db360025ddd263ee69274c1ebc780cdea158f302 (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!-- Sidebar -->
<section id="sidebar">

  <!-- Intro -->
  <section id="intro">
    {{ $pic := .Site.Params.intro.pic }}
    {{ with $pic.src }}
      {{ if $pic.circle }}
        <a href='{{"/" | relURL}}'><img src="{{ . | relURL }}" class="intro-circle" width="{{ $pic.width }}" alt="{{ $pic.alt }}" /></a>
      {{ else if $pic.imperfect }}
        <a href='{{"/" | relURL}}' class="logo"><img src="{{ . | relURL }}" alt="{{ $pic.alt }}" /></a>
      {{ else }}
        <a href='{{"/" | relURL}}'><img src="{{ . | relURL }}" width="{{ $pic.width }}" alt="{{ $pic.alt }}" /></a>
      {{ end }}
    {{ end }}
    {{ with .Site.Params.intro }}
      <header>
        <h2>{{ .header }}</h2>
        <p>{{ .paragraph | safeHTML }}</p>
      </header>
    {{ end }}
    {{ if .Site.Params.socialAppearAtTop }}
      <ul class="icons">
        {{ if .Site.Params.rssAppearAtTop }}
          <li>
            <a href="{{ .RSSLink }}" type="application/rss+xml" target="_blank" title="RSS" class="fa fa-rss"></a>
          </li>
        {{ end }}
        {{ partial "social" . }}
      </ul>
    {{ end }}
  </section>

  <!-- Posts List -->
  <section id="recent-posts">
    <div class="mini-posts">
      <header>
        <h3>Recent Posts</h3>
      </header>
      <div class="posts-container">
        {{ $.Scratch.Set "recentPosts" .Site.Pages }}

        {{ with .Site.Params.postAmount.sidebar }}
          {{ $.Scratch.Set "postLimit" . }}
        {{ else }}
          {{ $.Scratch.Set "postLimit" 5 }}
        {{ end }}

        {{ range first ($.Scratch.Get "postLimit") (where ($.Scratch.Get "recentPosts") "Type" "post") }}
          <article class="mini-post">
            <header>
              <h3>
                <a href="{{ .Permalink }}">{{ .Title }}</a>
              </h3>
              {{ $.Scratch.Set "dateType" .Date }}
              <time class="published" datetime='{{ ($.Scratch.Get "dateType").Format "2006-01-02" }}'>
                {{ ($.Scratch.Get "dateType").Format "January 2, 2006" }}
              </time>
            </header>
            {{ .Render "featured" }}
          </article>
        {{ end }}
      </div>

      {{ if ge (len (where .Site.Pages "Type" "post")) ($.Scratch.Get "postLimit") }}
        <a href=
          {{ with .Site.Params.viewMorePostLink }}
            {{ . }}
          {{ else }}
            "/post/"
          {{ end }}
        class="button">View more posts</a>
      {{ end }}
    </div>
  </section>

  <!-- This if statement only applies if someone goes to the /categories url -->
  <!-- Otherwise this section is shown for all other links -->
  {{ if ne ($.Scratch.Get "showCategories") false }}
  <!-- Categories List -->
    <section id="categories">
      <header>
        <h3>
          <a href="/categories/">Categories</a>
        </h3>
      </header>
        {{ if .Site.Params.categoriesByCount }}
          {{ $.Scratch.Set "categories" .Site.Taxonomies.categories.ByCount }}
        {{ else }}
          {{ $.Scratch.Set "categories" .Site.Taxonomies.categories.Alphabetical }}
        {{ end }}

        {{ range $key, $value := $.Scratch.Get "categories" }}
        <p>
          <article>
            <header>
              {{ if ne $value.Name "" }}
                <a href="/categories/{{ $value.Name | urlize }}/">{{ $value.Name }}</a>
                <span style="float:right;">{{ $value.Count }}</span>
              {{ else }}
                Uncategorized
                <span style="float:right;">{{ $value.Count }}</span>
              {{ end }}
            </header>
          </article>
        </p>
        {{ end }}
    </section>
  {{ end }}

  <!-- About -->
  {{ with .Site.Params.intro.about }}
    <section id="mini-bio">
      <h3>About</h1>
      <p>{{ . | safeHTML }}</p>
      <a href="/about/" class="button">Learn More</a>
    </section>
  {{ end }}

  <!-- Footer -->
  <section id="footer">
    {{ if .Site.Params.socialAppearAtBottom }}
      <ul class="icons">
        {{ if .Site.Params.rssAppearAtBottom }}
          <li>
            <a href="{{ .RSSLink }}" type="application/rss+xml" target="_blank" title="RSS" class="fa fa-rss"></a>
          </li>
        {{ end }}
        {{ partial "social" . }}
      </ul>
    {{ end }}
    <p class="copyright">
      {{ with .Site.Copyright | safeHTML }}
        {{ . }}
      {{ else }}
        &copy; {{ .Site.LastChange.Year }}
        {{if isset .Site.Params "author" }}
          {{ .Site.Params.author}}
        {{ else }}
          {{ .Site.Title }}
        {{ end }}
      {{end}}.
      Powered by <a href="//gohugo.io" target="_blank">Hugo</a>
    </p>
  </section>
</section>