aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/header.html
blob: 83f724fc134a1168bb18c76a20ed086bc012a321 (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
{{ if .Site.Author.gravataremail }}
    {{ .Scratch.Set "authorPicture" (printf "//www.gravatar.com/avatar/%s" (urlize (md5 (.Site.Author.gravataremail )))) }}
{{ else if .Site.Author.picture }}
    {{ .Scratch.Set "authorPicture" (absURL .Site.Author.picture) }}
{{ end }}

<nav class="dt w-100 border-box pa2">

    <i class="dtc dib v-mid dim fa fa-lg fa-bars"></i>

    <a href="{{ "/" | relLangURL }}" class="dtc v-mid link dim tc">
        <div class="f4 dib black-50">{{ .Site.Title }}</div>
    </a>

    {{ with ($.Scratch.Get "authorPicture") }}
    <a href="/#about" class="dtc dim tr">
        <img class="dib v-mid dib w2 h2 br-100" src="{{ . }}{{ if in . "//www.gravatar.com/avatar/" }}?s=90{{ end }}"/>
    </a>
    {{ end }}
</nav>

<nav id="sidebar" class="w-25-ns ba">
    <div class="tc pv4">
        <a href="/#about" class="">
            {{ with ($.Scratch.Get "authorPicture") }}
            <img class="br-100" src="{{ . }}{{ if in . "//www.gravatar.com/avatar/" }}?s=110{{ end }}"/>
            {{ end }}
            <h3 class="f3">
                {{ .Site.Author.name }}
            </h3>
        </a>
    </div>
    <ul class="list">
        {{ $currentPage := . }}
        {{ range .Site.Menus.main }}
        <li class="pv2">
            <a class="link {{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}active{{end}}" href="{{ .URL | relLangURL }}" title="{{ .Title }}">
                {{ .Pre }} {{ .Name }}</a>
            {{ end }}
        </li>
    </ul>
</nav>