Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect search to browspage #178

Merged
merged 6 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _includes/collection-nav-sgb.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
{%- endfor -%}
</ul>

{% include nav-search-lunr.html %}
{% include nav-search.html %}
koilebeit marked this conversation as resolved.
Show resolved Hide resolved
</div>
</div>
</nav>
28 changes: 28 additions & 0 deletions _includes/nav-search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script>
function site_search() {
var query = document.getElementById('site-search').value;
window.open("{{ '/browse.html' | relative_url }}#" + encodeURIComponent(query), '_self');
document.getElementById('site-search').value = '';
}
</script>
koilebeit marked this conversation as resolved.
Show resolved Hide resolved
<form class="form-inline my-2 my-lg-0" role="search" id="search" onsubmit="site_search(); return false;">
<div class="input-group">
<input
id="site-search"
class="form-control"
type="text"
placeholder="{{ site.data.translations['_includes']['nav-search-lunr.html']['search'][site.lang] | default: 'Search' }}"
koilebeit marked this conversation as resolved.
Show resolved Hide resolved
aria-label="Suchfeld"
>
<button class="btn btn-dark" type="submit">
<span id="search-icon">
<svg viewBox="0 0 1024 974" fill="white" height="16px" width="20px">
<path d="M960 832L710.875 582.875C746.438 524.812 768 457.156 768 384 768 171.96900000000005 596 0 384 0 171.969 0 0 171.96900000000005 0 384c0 212 171.969 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64C977.5 878.5 977.5 849.5 960 832zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256S525.375 640 384 640z"/>
</svg>
</span>
<span class="visually-hidden">
{{-  site.data.translations['_includes']['nav-search-lunr.html']['search'][site.lang] | default: 'Search' -}}
koilebeit marked this conversation as resolved.
Show resolved Hide resolved
</span>
</button>
</div>
</form>
koilebeit marked this conversation as resolved.
Show resolved Hide resolved