add optional navbar search

This commit is contained in:
Norwin 2022-07-30 14:04:38 +02:00
parent af02c706cb
commit ca24857b63
2 changed files with 22 additions and 0 deletions

View File

@ -4,6 +4,12 @@
<a class="navbar-item" href="{{ .Site.BaseURL }}">
<img src="{{ .Site.BaseURL }}images/gitea.png" alt="{{ .Site.Title }}">
</a>
{{ if eq .Site.Params.search "nav" }}
<!-- this works together with assets/js/search.js from the docs.gitea.io -->
<form action="{{ "search" | absLangURL }}">
<input id="search-query" name="s" placeholder="Search" />
</form>
{{ end }}
<span class="navbar-burger burger" data-target="navMenu" aria-label="menu" aria-expanded="false">
<span></span>
<span></span>

View File

@ -58,6 +58,18 @@
}
}
.navbar .navbar-brand {
align-items: center;
justify-content: space-between;
flex-grow: 1;
input {
height: 50%;
padding: 0.3rem;
margin-right: 0.75rem;
}
}
// Mobile Styles
.navbar {
@ -77,6 +89,10 @@
}
@media screen and (max-width:1023px){
.navbar .navbar-brand {
justify-content: initial;
}
.navbar-menu{
position: fixed;
bottom: 0;