1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-12 19:37:29 +00:00

Keep search terms in top bar

This commit is contained in:
Cadence Ember 2020-08-25 01:49:15 +12:00
parent 2cc6a2912a
commit 6180f858a7
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ module.exports = [
const fetchURL = new URL("http://localhost:3000/api/v1/search")
fetchURL.searchParams.set("q", query)
const results = await fetch(fetchURL.toString()).then(res => res.json())
return render(200, "pug/search.pug", {results})
return render(200, "pug/search.pug", {query, results})
}
}
]

View File

@ -2,7 +2,7 @@ doctype html
html
head
meta(charset="utf-8")
meta(name="viewport" value="width=device-width, initial-scale=1")
meta(name="viewport" content="width=device-width, initial-scale=1")
link(rel="stylesheet" type="text/css" href=getStaticURL("sass", "/main.sass"))
script(type="module" src=getStaticURL("html", "/static/js/focus.js"))
block head
@ -11,6 +11,6 @@ html
nav.main-nav
a(href="/").link.home CloudTube
form(method="get" action="/search").search-form
input(type="text" placeholder="Search" name="q" autocomplete="off").search
input(type="text" placeholder="Search" name="q" autocomplete="off" value=query).search
block content