Add optional navbar search (for docs.gitea.io) (#112)

Reviewed-on: https://gitea.com/gitea/theme/pulls/112
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: John Olheiser <john+gitea@jolheiser.com>
Co-authored-by: Norwin <noerw@noreply.gitea.io>
Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
Norwin 2022-07-31 09:44:20 +08:00 committed by John Olheiser
parent af02c706cb
commit 6ce483ae45
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;