Added the search bar to the footer

This commit is contained in:
Asaf Gartner 2022-02-10 22:27:28 +02:00
parent 1ce6ec080b
commit b2a2b49abe
5 changed files with 9 additions and 12 deletions

View File

@ -7793,10 +7793,6 @@ article code {
vertical-align: top; vertical-align: top;
width: 90%; } width: 90%; }
.site-search {
width: 100%; }
.site-search:focus {
width: 200%; }
.site-search[type=text].lite { .site-search[type=text].lite {
transition: border-bottom-color 60ms ease-in-out, width 300ms ease; } transition: border-bottom-color 60ms ease-in-out, width 300ms ease; }

View File

@ -720,12 +720,6 @@ footer {
} }
.site-search { .site-search {
width: 100%;
&:focus {
width: 200%;
}
&[type=text].lite { &[type=text].lite {
// wow CSS selector priority sucks // wow CSS selector priority sucks

View File

@ -29,4 +29,9 @@
<a href="{{ .Footer.ContactUrl }}">Contact</a> <a href="{{ .Footer.ContactUrl }}">Contact</a>
</li> </li>
</ul> </ul>
<form onsubmit="this.querySelector('input[name=q]').value = this.querySelector('#searchstring').value + ' site:handmade.network';" class="ma0 mt3 bg--card pa1 br2 dib" method="GET" action="{{ .Footer.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="18" />
<input id="search_button_homepage" type="submit" value="Go"/>
</form>
</footer> </footer>

View File

@ -75,6 +75,7 @@ type Footer struct {
ProjectIndexUrl string ProjectIndexUrl string
ForumsUrl string ForumsUrl string
ContactUrl string ContactUrl string
SearchActionUrl string
} }
type Thread struct { type Thread struct {

View File

@ -84,6 +84,7 @@ func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadc
ProjectIndexUrl: hmnurl.BuildProjectIndex(1), ProjectIndexUrl: hmnurl.BuildProjectIndex(1),
ForumsUrl: hmnurl.HMNProjectContext.BuildForum(nil, 1), ForumsUrl: hmnurl.HMNProjectContext.BuildForum(nil, 1),
ContactUrl: hmnurl.BuildContactPage(), ContactUrl: hmnurl.BuildContactPage(),
SearchActionUrl: "https://duckduckgo.com",
}, },
} }