all repos — searchix @ d40c0e188a7fe1b36887f59c4a9958faa81b3d44

Search engine for NixOS, nix-darwin, home-manager and NUR users

frontend/templates/blocks/search.gotmpl (view raw)

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
{{- define "main" }}
  <form id="search" role="search">
    <fieldset>
      <legend id="legend">
        <h2>{{ sourceNameAndType .Source }} search</h2>
      </legend>
      <input
        id="query"
        aria-labelledby="legend"
        name="query"
        type="search"
        value="{{ .Query }}"
        autofocus
        spellcheck="false"
      />
      <button>Search</button>
    </fieldset>
  </form>
  {{- if .Results }}
    {{ block "results" . }}{{ end }}
  {{- end }}
{{- end }}

{{- define "head" }}
  {{- with (index .Assets.Scripts "static/search.js") }}
    <script
      src="{{ .URL }}"
      defer
      integrity="sha256-{{ .Base64SHA256 }}"
    ></script>
  {{- end }}
{{- end }}