mirror of
https://github.com/Theodor-Springmann-Stiftung/jacoblenz.git
synced 2025-10-28 08:45:34 +00:00
Basic duckduckgo search
This commit is contained in:
@@ -180,6 +180,6 @@ module.exports = function (config) {
|
||||
},
|
||||
|
||||
// Set template formats so that other files won't be included in dist
|
||||
templateFormats: ["njk", "md", "html"]
|
||||
templateFormats: ["njk", "md", "liquid", "html"]
|
||||
};
|
||||
};
|
||||
@@ -37,7 +37,7 @@ This a template providing a sane base config for eleventy, mainly for the purpos
|
||||
| `npm run watch` | Run dev server in watch mode |
|
||||
| `npm run css_watch` | Watch for CSS changes & rebuild |
|
||||
| `npm run build` | First build the CSS, then the site |
|
||||
|
||||
| `npm run prod_build` | First build the CSS, then the site in production mode |
|
||||
## Other Settings
|
||||
```
|
||||
.\.eleventy.js
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
10
docs/static/js/search.js
vendored
Normal file
10
docs/static/js/search.js
vendored
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);
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
@@ -131,14 +131,17 @@
|
||||
</nav>
|
||||
<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="https://lenz-archiv.de">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="hidden desktop:block fixed bottom-0 text-sm text-center py-1 px-4 grow-0 shrink-0">
|
||||
Stand: 30.11.2023
|
||||
Stand: 12.12.2023
|
||||
| <a href="https://github.com/Theodor-Springmann-Stiftung/jacoblenz">Code</a> |
|
||||
<a href="/datenschutz/">Datenschutz & Impressum</a>
|
||||
</footer>
|
||||
|
||||
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