aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/navigator-middle.html
blob: 2c721207f57ac4712c84a9f2d577c388a015f2c4 (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
{{- $href := .Href -}}
{{- $id := or .Id "top" -}}
{{- $label := title $id -}}
{{- $icon := readFile (print (partial "function-paths.html").static "/icons/feather/arrow-up.svg") -}}
{{- $refresh := readFile (print (partial "function-paths.html").static "/icons/feather/refresh-cw.svg") -}}

{{- with $paginator := .Context.Paginator -}}
  {{- $href = or (and (eq $paginator.PageNumber 1) $href)
                 (and (gt $paginator.PageNumber 1) ($paginator.Prev.URL | absURL))
                 "#"
  -}}
{{- end -}}

{{- with .Icon -}}
  {{- $icon = readFile (print (partial "function-paths.html").static "/icons/feather/" . ".svg") -}}
{{- end -}}

{{- with .IconLabel -}}
  {{- $label = . -}}
{{- end -}}

<nav>
  <icon-button>
    <a
      data-update=""
      id="{{ $id }}"
      href="{{ $href }}"
     >
      {{ safeHTML $icon }}
      {{ safeHTML $refresh }}
      <small>{{ $label }}</small>
      <small>Update</small>
    </a>
  </icon-button>

  <section>
    {{ with .Title }}
      <h2>{{ . }}</h2>
    {{ end }}
    {{ with .Subtitle }}
      <small>{{ . }}</small>
    {{ end }}
  </section>

  {{ if .Context.Site.Menus.main }}
    {{ range .Context.Site.Menus.main }}
    <icon-navigator hidden="">
      <icon-button>
          <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}">
            {{ with .Identifier }}
              {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }}
              {{ safeHTML (readFile $icon) }}
            {{ end }}
            <small>{{ delimit (first 1 (split .Name " ")) " " }}</small>
          </a>
      </icon-button>
    </icon-navigator>
    {{ end }}
  {{ end }}

  <search-entry id="search-frame">
    <form
      id="search-form"
      action="https://lite.duckduckgo.com/lite/"
    >
      <input required
        id="search-input"
        name="q"
        value=""
        type="search"
        autocomplete="off"
        spellcheck="false"
        aria-autocomplete="list"
        aria-label="search input"
      />
      <button id="search-submit">
        {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/search.svg")) }}
        <small>Search</small>
      </button>
      <ul hidden="" id="search-results"></ul>
    </form>
   </search-entry>
 </nav>

<navigation-separator>
  <hr hidden="" />
</navigation-separator>