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

nav.html « partials « layouts - github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6cf4c96fd09859998bb0e869f1bcc08ac97614a (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
<!-- Begin Nav bar -->
<div class="container">
    <hr>
    <nav class="nav nav-center">
        {{ $isHome := .Page.IsHome }}
        {{ if not $isHome }}
        <span id="nav-toggle" class="nav-toggle"  onclick="document.getElementById('nav-menu').classList.toggle('is-active');">
            <span></span>
            <span></span>
            <span></span>
        </span>
        <div id="nav-menu" class="nav-left nav-menu">
        {{ end }}
            {{ if not $isHome }}
            <a class="nav-item" href="{{ "/" | relLangURL }}">{{ i18n "nav_main" . }}</a>
            {{ end }}
            {{ with .Site.GetPage "page" "about" }}
            <a class="nav-item" href="{{ if $isHome }}#{{ .Title | urlize }}{{ else }}{{ printf "/#%s" (.Title | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a>
            {{ end }}

            {{ $pageIsInProjects := eq .Page.Section "projects"}}
            {{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
            {{ with .Site.GetPage "section" "projects" }}
            {{ if $isHome }}
            <a class="nav-item" href="#{{ .Title | urlize }}">{{ .Title }}</a>
            {{ else }}
            <a class="nav-item" href="{{ .RelPermalink }}">
                {{ if $pageIsInProjects }}
                {{ i18n "nav_backToSection" . }}
                {{ else }}
                {{ .Title }}
                {{ end }}
            </a>
            {{ end }}
            {{ end }}
            {{ end }}

            {{ $pageIsInBlog := eq .Page.Section "blog"}}
            {{ if not (and $pageIsInBlog (eq .Page.Kind "section")) }}
            {{ with .Site.GetPage "section" "blog" }}
            {{ if $isHome }}
            <a class="nav-item" href="#{{ .Title | urlize }}">{{ .Title }}</a>
            {{ else }}
            <a class="nav-item" href="{{ .RelPermalink }}">
                {{ if $pageIsInBlog }}
                Back to {{ .Title | singularize}}
                {{ else }}
                {{ .Title | singularize}}
                {{ end }}
            </a>
            {{ end }}
            {{ end }}
            {{ end }}

            {{ with .Site.GetPage "page" "contact" }}
            <a class="nav-item" href="{{ if $isHome }}#{{ .Title | urlize }}{{ else }}{{ printf "/#%s" (.Title | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a>
            {{ end }}

            {{ range $.Site.Home.AllTranslations.ByWeight }}
            <a class="nav-item" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
            {{ end }}

            {{ if and .Site.Params.showRSSButton .Site.RSSLink  }}
            <a class="nav-item" href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a>
            {{ end }}
        {{ if not .Page.IsHome }}
        </div>
    {{ end }}
    </nav>
    <hr>
</div>
<!-- End Nav bar -->