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

sidebar.html « partials « layouts - github.com/parsiya/Hugo-Octopress.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8582d9cb2ed7fcdc474fe9fdc6fb0404daf0c829 (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
<!-- To modify sidebar width check the css file lines 757 and 765 (for large screens) -->

<aside class="sidebar thirds">
  <section class="first odd">

    {{ with .Site.Params.sidebarHeader }}
      <h1>{{ . | markdownify }}</h1>
    {{ end }}

    <p>
      {{ with .Site.Params.sidebarText }}
        {{ . | markdownify }}
      {{ end }}
    </p>
  </section>

  <!-- Social media icons are moved to social.html -->
  {{ partial "social.html" . }}

  <!-- Sidebar menu - items are read from the config file
       first we check if it is enabled in config file and then start adding items.
       if Site.Params.sidebarNewWindow exists and is set to true then open these links in a new window -->

  {{ with .Site.Params.sidebarMenuEnabled }}
    {{ if eq . true }}
      <section class="odd">
        {{ with $.Site.Params.sidebarMenuHeader }}
          <h1>{{ . }}</h1>
        {{ end }}
        {{ range $.Site.Menus.sidebar }}
          <li>
            <a href="{{ .URL | absURL }}" title="{{ .Name }}" {{ if eq $.Site.Params.sidebarNewWindow true }} target="_blank" rel="noopener noreferrer" {{ end }}>{{ .Name }}</a>
          </li>
        {{ end }}
      </section>
    {{ end }}
  {{ end }}

  <!-- Add recent posts - limit is .Site.Params.sidebarRecentLimit - example copied from https://gohugo.io/templates/go-templates/ -->
  <!-- Only display this section if sideBarRecentLimit is not zero -->
  {{ with .Site.Params.sidebarRecentLimit }}
    {{ if not (eq . 0) }}
      <section class="even">
        <h1>Recent Posts</h1>
        <ul id="recent_posts">
          {{ $pages := where $.Site.Pages "Type" "post" }}
          {{ range first . $pages }}
            {{ if .IsPage }}
              <li class="post">
                <a href="{{ .RelPermalink }}">{{ .Title }}</a>
              </li>
            {{ end }}
          {{ end }}
        </ul>
      </section>
    {{ end }}
  {{ end }}
</aside>