mirror of
https://github.com/Theodor-Springmann-Stiftung/jacoblenz.git
synced 2025-10-30 01:35:33 +00:00
Basic duckduckgo search
This commit is contained in:
14
src/dynamic/lunr.liquid_unused
Normal file
14
src/dynamic/lunr.liquid_unused
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
permalink: /index.json
|
||||
---
|
||||
|
||||
[
|
||||
{% for character in collections.characters %}
|
||||
{
|
||||
"title":"{{ character.data.title }}",
|
||||
"url":"{{ character.url }}",
|
||||
"content":"{% excerpt character %}"
|
||||
}
|
||||
{% if forloop.last == false %},{% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
@@ -1,8 +1,11 @@
|
||||
<div class="hidden desktop:block">
|
||||
<div class="bg-slate-50 border-t border-lenz-11-blue py-5 px-4">
|
||||
<form class="flex flex-row w-full">
|
||||
<input class="px-1.5 italic border border-gray-500 grow" type="text" placeholder="Suchbegriff..." disabled/>
|
||||
<button class="inline-block ml-2 px-2 border border-gray-500 text-gray-500 italic " disabled>Suche</button>
|
||||
<form action="https://duckduckgo.com/" method="get" id="global-search-form" class="flex flex-row w-full">
|
||||
<div class="flex flex-row w-full">
|
||||
<input class="px-1.5 italic border border-gray-500 grow" type="text" name="q" placeholder="Suchbegriff..." required/>
|
||||
<button id="global-search-button" class="inline-block ml-2 px-2 border border-gray-500 text-gray-500 italic" type="submit" >Suche</button>
|
||||
</div>
|
||||
<input class="grow-0 shrink" type="hidden" name="sites" value="{{ config.url }}">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
10
src/static/js/search.js
Normal file
10
src/static/js/search.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// attach a click handler to the search link
|
||||
var btn = document.querySelector('#global-search-form');
|
||||
btn.addEventListener('submit', function(event) {
|
||||
|
||||
// don't navigate to that page. Stay put.
|
||||
event.preventDefault();
|
||||
|
||||
// make search magic happen instead...
|
||||
|
||||
}, false);
|
||||
Reference in New Issue
Block a user