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: e66f910da91e7f7c0c69f1c65f825775623fde6b (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
<!-- 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>

<!-- Font awesome icons - code taken from the Hyde-x theme - "Font Awesome by Dave Gandy - http://fontawesome.io"
     Icons: https://fortawesome.github.io/Font-Awesome/icons/
     to give icons square dark backgrounds use them like this: fa fa-key-square
     size is fa-3x, sizes are 1-5
 -->

  <!-- Sidebar social network icons -->
  <ul class="sidebar-nav">
    <li class="sidebar-nav-item">
      {{ with .Site.Params.github }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-github fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.bitbucket }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-bitbucket fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.gitlab }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-gitlab fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.twitter }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-twitter fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.keybase }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fas fa-key fa-3x"></i></a>{{ end }} <!-- added keybase -->
      {{ with .Site.Params.linkedin }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-linkedin fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.stackOverflow }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-stack-overflow fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.googleplus }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-google-plus fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.facebook }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-facebook fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.youtube }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-youtube fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.instagram }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-instagram fa-3x"></i></a>{{ end }}
      {{ with .Site.Params.bitcoin }}<a target="_blank" href="{{ . }}" title="{{ . }}"><i class="fab fa-bitcoin fa-3x"></i></a>{{ end }}

    <!-- don't need RSS here anymore -->
    <!-- {{ if .Site.Params.rss }}<a href="{{ "/index.xml" | absURL }}" type="application/rss+xml" title="RSS"><i class="fa fa-rss-square fa-3x"></i></a>{{ end }} -->
    </li>
  </ul>

  <!-- sidebar menu - items are read from the config file
       first we check if it is enabled in config file and then start adding the 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" {{ 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>