revert to duckduckgo search if JS is disabled

This commit is contained in:
Wouter Groeneveld 2022-11-11 10:34:07 +01:00
parent e3603906a1
commit e191d54bca
3 changed files with 22 additions and 11 deletions

View File

@ -10,17 +10,7 @@ The preservation of once freshly baked but now perhaps stale thoughts.<br/> Not
### By search
<script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search", resetStyles: false });
});
</script>
<noscript>
... Sorry, search functionality requires JavaScript to be enabled.
</noscript>
{{< search >}}
### By category

View File

@ -0,0 +1,20 @@
<script src="/_pagefind/pagefind-ui.js" type="text/javascript"></script>
<div id="search"></div>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: "#search", resetStyles: false });
});
</script>
<noscript>
<form role="search" method="get" action="https://duckduckgo.com/" id="search">
<input type="text" style="width: 80%" name="q" placeholder="Search with DuckDuckGo…">
<input type="hidden" name="ia" value="web">
<input type="hidden" name="kaj" value="m">
<input type="hidden" name="k7" value="w">
<input type="hidden" name="k9" value="b">
<input type="hidden" name="ks" value="l">
<input type="hidden" name="sites" value="{{ $.Site.BaseURL }}">
<button type="submit" value="Search">Search</button>
</form>
</noscript>

View File

@ -9,6 +9,7 @@
button
background-color: white
height: 2.7em
border: 1px solid $accent
color: $accent