Implementeren zoekfunctionaliteit

This commit is contained in:
Michael Boelen 2023-05-18 13:03:01 +02:00
parent 55c242d4b6
commit 372746317e
16 changed files with 247 additions and 13 deletions

View file

@ -30,5 +30,6 @@
{{ end }}
</ul>
</nav>
<a href="/zoeken/">{{ partial "show-svg-icon.html" (dict "context" . "icon" "magnifying-glass") }}</a>
</div>
</header>

View file

@ -0,0 +1,15 @@
<script src="{{ "js/search.js" | absURL }}"></script>
{{ $assetBusting := not .Site.Params.disableAssetsBusting }}
{{ $scripts := getJSON "assets/js/scripts.json" }}
{{ $.Scratch.Set "jslibs" slice }}
{{ range $scripts.scripts }}
{{ $.Scratch.Add "jslibs" (resources.Get . ) }}
{{ end }}
{{ $js := .Scratch.Get "jslibs" | resources.Concat "js/combined-scripts.js" | resources.Minify | fingerprint }}
<script
src="{{ $js.RelPermalink }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"
integrity="{{ $js.Data.Integrity }}"
></script>

View file

@ -0,0 +1,4 @@
<form action="/zoeken/" method="GET">
🔍 <input type="search" name="q" id="search-query" placeholder="Zoekterm..">
<button type="submit">Zoek</button>
</form>