fix: replace sidebar PagefindUI with redirect search form

PagefindUI in the ~300px sidebar caused 218+ results to expand inline,
pushing content down with poor readability. Replace with a simple GET
form that redirects to /search/?q=query in all four sidebars.

Confab-Link: http://localhost:8080/sessions/4d40ef89-a713-48c1-b4ed-0ffafca25677
This commit is contained in:
Ricardo
2026-03-04 19:12:07 +01:00
parent 8136640619
commit c077237f1d
5 changed files with 14 additions and 25 deletions
+1 -6
View File
@@ -133,12 +133,7 @@
{% elif widget.type == "recent-comments" %}
{% include "components/widgets/recent-comments.njk" %}
{% elif widget.type == "search" %}
<is-land on:visible>
<div class="widget">
<div id="blog-sidebar-search"></div>
<script>initPagefind("#blog-sidebar-search");</script>
</div>
</is-land>
{% include "components/widgets/search.njk" %}
{% elif widget.type == "fediverse-follow" %}
{% include "components/widgets/fediverse-follow.njk" %}
{% elif widget.type == "custom-html" %}
+1 -7
View File
@@ -18,13 +18,7 @@
{% elif widget.type == "categories" %}
{% include "components/widgets/categories.njk" %}
{% elif widget.type == "search" %}
<is-land on:visible>
<div class="widget">
<h3 class="widget-title">Search</h3>
<div id="sidebar-search"></div>
<script>initPagefind("#sidebar-search");</script>
</div>
</is-land>
{% include "components/widgets/search.njk" %}
{% elif widget.type == "webmentions" %}
{% include "components/widgets/webmentions.njk" %}
{% elif widget.type == "custom-html" %}
+1 -6
View File
@@ -108,12 +108,7 @@
{% elif widget.type == "categories" %}
{% include "components/widgets/categories.njk" %}
{% elif widget.type == "search" %}
<is-land on:visible>
<div class="widget">
<div id="sidebar-search"></div>
<script>initPagefind("#sidebar-search");</script>
</div>
</is-land>
{% include "components/widgets/search.njk" %}
{% elif widget.type == "webmentions" %}
{% include "components/widgets/webmentions.njk" %}
{% elif widget.type == "recent-comments" %}
+1 -6
View File
@@ -120,12 +120,7 @@
{% elif widget.type == "recent-comments" %}
{% include "components/widgets/recent-comments.njk" %}
{% elif widget.type == "search" %}
<is-land on:visible>
<div class="widget">
<div id="listing-sidebar-search"></div>
<script>initPagefind("#listing-sidebar-search");</script>
</div>
</is-land>
{% include "components/widgets/search.njk" %}
{% elif widget.type == "webmentions" %}
{% include "components/widgets/webmentions.njk" %}
{% elif widget.type == "fediverse-follow" %}
+10
View File
@@ -0,0 +1,10 @@
{# Search Widget — redirects to /search/?q=query #}
<form action="/search/" method="get" class="flex gap-2">
<input type="text" name="q" placeholder="Search..."
class="flex-1 min-w-0 px-3 py-2 text-sm rounded-lg border border-surface-300 dark:border-surface-600 bg-white dark:bg-surface-800 text-surface-900 dark:text-surface-100 placeholder-surface-400 dark:placeholder-surface-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500">
<button type="submit" class="px-3 py-2 text-sm font-medium rounded-lg bg-primary-600 text-white hover:bg-primary-700 transition-colors" aria-label="Search">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</button>
</form>