Search with DDG

This commit is contained in:
Asaf Gartner 2021-08-17 23:09:24 +03:00
parent 20c05637d9
commit 8a07e8bc3b
2 changed files with 4 additions and 4 deletions

View File

@ -66,9 +66,9 @@
{{ end }}
</div>
</div>
<form class="dn ma0 flex-l flex-column justify-center items-end" method="post" action="{{ .Header.SearchActionUrl }}" target="_blank">
{{/* TODO: CSRF? */}}
<input class="site-search bn lite pa2 fira" type="text" name="term" value="" placeholder="Search with Google" size="17" />
<form onsubmit="this.querySelector('input[name=q]').value = this.querySelector('#searchstring').value + ' site:handmade.network';" class="dn ma0 flex-l flex-column justify-center items-end" method="GET" action="{{ .Header.SearchActionUrl }}" target="_blank">
<input type="hidden" name="q" />
<input class="site-search bn lite pa2 fira" type="text" id="searchstring" value="" placeholder="Search with DuckDuckGo" size="17" />
<input id="search_button_homepage" type="submit" value="Go"/>
</form>
</div>

View File

@ -288,7 +288,7 @@ func getBaseData(c *RequestContext) templates.BaseData {
ManifestoUrl: hmnurl.BuildManifesto(),
EpisodeGuideUrl: hmnurl.BuildHomepage(), // TODO(asaf)
EditUrl: "",
SearchActionUrl: hmnurl.BuildHomepage(), // TODO(asaf)
SearchActionUrl: "https://duckduckgo.com",
},
Footer: templates.Footer{
HomepageUrl: hmnurl.BuildHomepage(),