theme/layouts/partials/navbar.html
John Olheiser aa3c84e28b Trailing slash for search (#122)
Noted by a user on Discord that our search stopped working.

It appears that our new host is set up to redirect non-trailing slash paths to trailing slash paths, discarding the query parameters.

One option is to change it back, another is this PR which simply adds the trailing slash to the form action.

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: https://gitea.com/gitea/theme/pulls/122
Reviewed-by: pat-s <pat-s@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-22 00:31:22 +08:00

26 lines
887 B
HTML

<nav class="navbar">
<div class="container">
<div class="navbar-brand">
<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>
<span></span>
</span>
</div>
<div class="navbar-menu" id="navMenu">
<div class="navbar-end">
{{ partial "toplinks.html" . }}
</div>
</div>
<div class="navbar-background" id="navbar-background"></div>
</div>
</nav>