Site: search over the documentation (#60)
Site / build (pull_request) Successful in 12s

A search page whose index is the page itself: one item for each page and
each heading of the guide, the how-tos, the FAQ and the developer docs,
written by Zola from the pages' own content. A small script filters and
ranks them as you type. Nothing is fetched, so the Content-Security-Policy
needs nothing new; without JavaScript the page is a list of every heading.

The navigation gets a link, and the documentation's index pages a box that
is a plain form to /search/?q=. The devlog is not searched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-07 18:50:33 +02:00
co-authored by Claude Opus 5.5
parent 5823584bfd
commit 834c6eb0f2
10 changed files with 251 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
{% extends "base.html" %}
{% import "macros/search.html" as search %}
{% block title %}{{ page.title }}: roro9stack{% endblock %}
{% block description %}{{ page.description }}{% endblock %}
{% block head %}<script src="/js/search.js" defer></script>{% endblock %}
{% block main %}
{# The whole index is in this page (issue #60): nothing is fetched, and without JavaScript it is
still a list of every page and heading of the documentation. js/search.js filters it. #}
<div class="wrap page">
<header>
<span class="eyebrow">Documentation</span>
<h1>{{ page.title }}</h1>
<p class="lead">{{ page.description }}</p>
</header>
<form class="search-form" action="/search/" method="get" role="search">
<label for="q">Search the guide, the how-tos, the FAQ and the developer docs</label>
<input id="q" name="q" type="search" autocomplete="off" spellcheck="false" placeholder="Probation, Safe Mode, rm -r, ...">
<button class="btn btn-primary n-md" type="submit">Search</button>
</form>
<p class="s-status muted" id="s-status" role="status" aria-live="polite"></p>
<ol class="s-results" id="s-results" hidden></ol>
<div class="s-index" id="s-index">
<p class="muted s-nojs">Every page of the documentation and its headings. With JavaScript on, the box above searches their text.</p>
{% set guide = get_section(path="guide/_index.md") %}
<section><h2>{{ guide.title }}</h2><ul>
{% for p in guide.pages %}{{ search::entries(page=p, group="Guide") }}{% endfor %}
</ul></section>
{% set howto = get_section(path="howto/_index.md") %}
<section><h2>{{ howto.title }}</h2><ul>
{% for p in howto.pages %}{{ search::entries(page=p, group="How-to") }}{% endfor %}
</ul></section>
<section><h2>Questions and answers</h2><ul>
{{ search::entries(page=get_page(path="faq.md"), group="FAQ") }}
</ul></section>
{% set dev = get_section(path="dev/_index.md") %}
{% for path in dev.subsections %}
{% set sub = get_section(path=path) %}
<section><h2>Developers: {{ sub.title }}</h2><ul>
{% for p in sub.pages %}{{ search::entries(page=p, group=sub.extra.search | default(value=sub.title)) }}{% endfor %}
</ul></section>
{% endfor %}
</div>
</div>
{% endblock main %}