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

navbar.html « partials « layouts - github.com/jpescador/hugo-future-imperfect.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4dbb7a0ed0c62d850efa67ea22739dd128dcb93 (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
<!-- Header -->
<header id="header">
    {{ if .IsHome }}
        <h1><a href="/">{{ .Site.Params.navbarTitle }}</a></h1>
    {{ else }}
        <h1><a href="/">{{ .Section }}</a></h1>
    {{ end }}

    <nav class="links">
        <ul>
            {{ range .Site.Menus.main }}
                <li>
                    <a href="{{ .URL }}">
                            <i class="{{ .Identifier }}">&nbsp;</i>{{ .Name }}
                    </a>
                </li>
            {{ end }}
        </ul>
    </nav>
    <nav class="main">
        <ul>
            {{ if $.Scratch.Get "shareNav" }}
            <li id="share-nav" class="share-menu" style="display:none;">
                <a class="fa-share-alt" href="#share-menu">Share</a>
            </li>
            {{ end }}
            <li class="search">
                <a class="fa-search" href="#search">Search</a>
                <form id="search" method="get" action="//google.com/search">
                    <input type="text" name="q" placeholder="Search" />
                    <input type="hidden" name="as_sitesearch" value="{{ .Site.BaseURL }}">
                </form>
            </li>
            <li class="menu">
                <a class="fa-bars" href="#menu">Menu</a>
            </li>
        </ul>
    </nav>
</header>

<!-- Menu -->
<section id="menu">

    <!-- Search -->
        <section>
            <form class="search" method="get" action="//google.com/search">
                <input type="text" name="q" placeholder="Search" />
                <input type="hidden" name="as_sitesearch" value="{{ .Site.BaseURL }}">
            </form>
        </section>

    <!-- Links -->
        <section>
            <ul class="links">
                {{ range .Site.Menus.main }}
                    <li>
                        <a href="{{ .URL }}">
                            <h3>
                                <i class="{{ .Identifier }}">&nbsp;</i>{{ .Name }}
                            </h3>
                        </a>
                    </li>
                {{ end }}
            </ul>
        </section>

    <!-- Posts List -->
        <section id="recent-posts">
            <div class="mini-posts">
                <header>
                    <h3>Recent Posts</h3>
                </header>
                {{ $.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 }}

                {{ 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>

    <!-- Actions -->
        <!--
        <section>
            <ul class="actions vertical">
                <li><a href="#" class="button big fit">Log In</a></li>
            </ul>
        </section>
        -->
</section>