mirror of
https://git.sr.ht/~cadence/cloudtube
synced 2024-12-22 13:07:00 +00:00
Keep search terms in top bar
This commit is contained in:
parent
2cc6a2912a
commit
6180f858a7
@ -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})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user