Skip to content

Commit 7f91602

Browse files
committed
Adds files for separate search page
1 parent 75b9fb0 commit 7f91602

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

content/search.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Search this site
3+
type: docs
4+
---
5+
6+
{{< search-form >}}

layouts/partials/navbar.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
</ul>
6161
</div>
6262
<div class="navbar-nav d-none d-lg-block">
63-
<!-- Comment out navbar search because pagefind handles only one search instance -->
64-
<!-- {{ partial "search-input.html" . }} -->
63+
{{ partial "search-input.html" . }}
6564
</div>
6665
</nav>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{{ if .Site.Params.offlineSearchPagefind }}
2-
<div class="search">
3-
<div id="search"></div>
2+
<div class="main-menu-search pr-2">
3+
<a href="/search">
4+
<svg width="30" height="31" viewBox="0 0 50 52" fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg"><path opacity=".945" fill-rule="evenodd" clip-rule="evenodd" d="M45.381 50.122 28.404 33.357l3.1-3.14 16.978 16.765-3.1 3.14Z" fill="#FFFFFF"/><path opacity=".945" fill-rule="evenodd" clip-rule="evenodd" d="M19.372 6.63c-7.63 0-13.77 6.102-13.77 13.57 0 7.469 6.14 13.57 13.77 13.57 7.631 0 13.77-6.102 13.77-13.57S27.003 6.63 19.372 6.63ZM1.19 20.2c0-9.957 8.167-17.982 18.182-17.982 10.016 0 18.182 8.025 18.182 17.982 0 9.958-8.166 17.983-18.182 17.983C9.357 38.183 1.19 30.158 1.19 20.2Z" fill="#FFFFFF"/></svg>
5+
</a>
46
</div>
5-
{{ end }}
7+
{{ end }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<link href='{{ "/pagefind/pagefind-ui.css" }}' rel="stylesheet">
2+
<script src='{{ "/pagefind/pagefind-ui.js" }}' defer type="application/x-javascript"></script>
3+
4+
<div id="search"></div>
5+
<script>
6+
window.addEventListener("DOMContentLoaded", (event) => {
7+
new PagefindUI({ element: "#search", showSubResults: true, highlightParam: "highlight" });
8+
});
9+
</script>

0 commit comments

Comments
 (0)