diff --git a/api/search.js b/api/search.js index 26b79e6..11695db 100644 --- a/api/search.js +++ b/api/search.js @@ -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}) } } ] diff --git a/pug/includes/layout.pug b/pug/includes/layout.pug index 23c56e8..d8d40fb 100644 --- a/pug/includes/layout.pug +++ b/pug/includes/layout.pug @@ -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