diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-22 20:45:13 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-10-22 20:45:13 +0200 |
| commit | e562b773ba37f01b0175336db6308b729f7b6f02 (patch) | |
| tree | e9574cfd54fc54ddf33ed5cc35f8ff7a1c39d56d /templates/index.html | |
| parent | 3350937e07894460c42acfe64afe8da012c6cbee (diff) | |
| download | mitjafelicijan.com-e562b773ba37f01b0175336db6308b729f7b6f02.tar.gz | |
Removed search options from index
Diffstat (limited to 'templates/index.html')
| -rw-r--r-- | templates/index.html | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/templates/index.html b/templates/index.html index 49b670d..f5821fc 100644 --- a/templates/index.html +++ b/templates/index.html | |||
| @@ -11,40 +11,6 @@ | |||
| 11 | bytes (trigraphs). | 11 | bytes (trigraphs). |
| 12 | </a> | 12 | </a> |
| 13 | 13 | ||
| 14 | <section class="quick-jump"> | ||
| 15 | <input list="qj-posts" placeholder="Look for posts"> | ||
| 16 | <datalist id="qj-posts"> | ||
| 17 | {{ range .Pages }} | ||
| 18 | {{ if and (eq .Type "post") (not .Draft) }} | ||
| 19 | <option data-url="{{ .RelPermalink }}">{{ .Title }}</option> | ||
| 20 | {{ end }} | ||
| 21 | {{ end }} | ||
| 22 | </datalist> | ||
| 23 | <input list="qj-notes" placeholder="Look for notes"> | ||
| 24 | <datalist id="qj-notes"> | ||
| 25 | {{ range .Pages }} | ||
| 26 | {{ if and (eq .Type "note") (not .Draft) }} | ||
| 27 | <option data-url="{{ .RelPermalink }}">{{ .Title }}</option> | ||
| 28 | {{ end }} | ||
| 29 | {{ end }} | ||
| 30 | </datalist> | ||
| 31 | </section> | ||
| 32 | |||
| 33 | <script> | ||
| 34 | document.querySelectorAll("section.quick-jump input[list]").forEach(s => { | ||
| 35 | s.addEventListener("change", e => { | ||
| 36 | const input = e.target; | ||
| 37 | const datalist = e.target.list; | ||
| 38 | for (var j = 0; j < datalist.options.length; j++) { | ||
| 39 | if (input.value == datalist.options[j].value) { | ||
| 40 | console.log(input.value, datalist.options[j].dataset.url); | ||
| 41 | window.location.href = `/${datalist.options[j].dataset.url}`; | ||
| 42 | } | ||
| 43 | } | ||
| 44 | }); | ||
| 45 | }); | ||
| 46 | </script> | ||
| 47 | |||
| 48 | <section> | 14 | <section> |
| 49 | <h2>More long form, ramblings etc</h2> | 15 | <h2>More long form, ramblings etc</h2> |
| 50 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="More long form, ramblings etc"> | 16 | <ul itemscope itemtype="https://schema.org/SiteNavigationElement" role="list" aria-label="More long form, ramblings etc"> |
