search.json| Commit | Message |
|---|---|
ac75fabf3 | Github pages migrated to Asciidoc |
---
layout: null # Critical: without this, JSON would be wrapped in HTML
---
[
{% for doc in site.docs %}
{
"title": "{{ doc.title | escape }}",
"category": "{{ doc.category }}",
"tags": "{{ doc.tags | join: ', ' }}",
"url": "{{ site.baseurl }}{{ doc.url }}",
"date": "{{ doc.date }}"
} {% unless forloop.last %},{% endunless %}
{% endfor %}
]layout: null: Without this, Jekyll wraps the JSON in the site's HTML template (header, nav, footer) — producing invalid JSON. The null layout outputs raw content.
{% unless forloop.last %},{% endunless %}: Adds commas between array elements but NOT after the last element. A trailing comma would produce invalid JSON. Liquid has no built-in "generate valid JSON" filter — this manual comma control is necessary.
Limitations: Only the site.docs collection is indexed — blog posts, FAQs, and changelogs are NOT searchable. Only title/tag matching — no full-text search of document content. All metadata loaded into the browser on first search — not scalable to thousands of pages.
This file is NOT a static JSON file — it's a Jekyll template processed at build time. The workflow:
{% for doc in site.docs %}— iterates every document in the_docs/collection (installation.adoc, userguide.adoc, development.adoc, etc.) — and generates a staticsearch.jsonfile in the output directory./search/(#4093), the Tipue Search jQuery plugin fetches/search.json, filters entries client-side, and renders results — no server, no database, no API.This is static site search — the entire searchable corpus is a single pre-computed JSON file. Fast, cheap, but doesn't scale beyond a few hundred pages.