diff --git a/routes/search.js b/routes/search.js
index 2774ba9..dc47d62 100644
--- a/routes/search.js
+++ b/routes/search.js
@@ -20,11 +20,12 @@ module.exports.GET = async (req, res) => {
}
// Search, if we have a query.
+ const path = `/search?q=${url.search.q}&`
const {limit, offset} = pagination.getValuesToPaginate({ currentPage: p, perPage: PER_PAGE })
const results = await ds.search(db, q, limit, offset)
const count = await ds.searchCount(db, q)
const totalPages = pagination.getTotalPages({ totalItems: count, perPage: PER_PAGE })
- const out = await page.render('search', { q, rawQ: url.search.q, p, results, count, totalPages })
+ const out = await page.render('search', { path, q, p, results, count, totalPages })
return send(res, 200, out)
//return send(res, 200, { results, count })
diff --git a/templates/_pagination.ejs b/templates/_pagination.ejs
index dcc5fcc..6b8cefc 100644
--- a/templates/_pagination.ejs
+++ b/templates/_pagination.ejs
@@ -8,7 +8,7 @@
<% if (i == p) { %>
<%- i %>
<% } else { %>
- <%- i %>
+ <%- i %>
<% } %>
<% } %>