---
author: R. S. Doiel
dateCreated: 2026-11-26T00:00:00Z
dateModified: "2026-11-28"
datePublished: 2026-11-28T00:00:00Z
description: |
    An exploration of how the PageFind approach to static site search
    could be adapted for the Markdown Web
keywords:
    - search
    - indexing
    - markdown web
postPath: blog/2026/11/28/rethinking_web_search_p1.md
title: Rethinking static site search for the Markdown Web

---


# Rethinking a static site search for a Markdown Web

By R. S. Doiel, 2026-11-28

I think the Markdown Web gives us a great opportunity to rethink how we do things including how we implement search engines. An idea I've been mulling over is largely inspired by [PageFind](https://pagefind.app "HTML website about PageFind from Cloud Cannon") and [Open Search Description Format](https://developer.mozilla.org/en-US/docs/Web/XML/Guides/OpenSearch "link to HTML page about Open Search Description Format"). The former gave us a robust browser side search for static HTML and the latter provides a means for a Web Browser to include a site's search as a standard search engine web service (examples DuckDuckGo, Wikipedia). I think both ideas can be aligned with the Markdown Web and useful to it.

The PageFind app provides a nice set of indexes that enable browser side site search for static sites[^1]. These indexes can be aggregated across sites or sub-sites. PageFind search setup can even be described by an Open Search Description so it becomes a supported search service in your web browser like DuckDuckGo or Wikipedia search. Of course this can't work for the Markdown Web. Neither WASM nor JavaScript are supported. Then there is the problem that Markdown can't express a web form without embedding HTML. What then supplies the search UI for a search service?

[^1]: PageFind is clever. When it indexes your HTML it actually creates a set of partial indexes. Only the part that is needed for a query is downloaded to your web browser. This let's PageFind support a larger number of index pages than earlier approaches like Oliver Nightengale's <https://lunrjs.com>.

The [BonBon](https://github.com/scripting/bonBon "GitHub project link, HTML") gives us a hint in the direction we might explore. In `/.well-known/bonbon.json` there is an attribute that can point at a search engine's URLs. The Open Search Description works because an HTML page can point to the XML file describing the supported search. Since the Open Search Description Format already exists why not use that? What if a similar JSON file points at an existing document that provides an Open Search Description? The existing standard document we use to be able to easily add a searching to our HTML Web browser could be reused for the Markdown Web. We only need to know if it exists and what the URL is needed to retrieve it. The search template string provides the missing piece of how to form the search query that a browser can request. Unlike the HTML Web the search UI would be part of the browser, not a web page. Markdown can't express a web form without embedded HTML so is invisible on the Markdown Web.

What about running the search. We have existing heavy weight search engines we could run like Solr and OpenSearch. These can index lots of document types and reply with a JSON or XML response. We'd need to have some sort of service that would turn those into Markdown results for the Markdown Web. I think we can skip them and build something lighter weight focused on the news of the Markdown Web.

## How does Web search really work?

Search engines can be abstracted into several parts. There is an indexer which takes a document, tokenizes it's content and adds or updates an index. A Markdown Web oriented indexer focuses on Markdown documents rather thank HTML, PDF, etc. Since Markdown documents can carry front mater (metadata), we can take advantage of that in our indexer. 

How do you know what documents to index? You need a mechanism to discover what documents are available to be tokenized and indexed. This is sometimes referred to as a crawler or spider. On the early HTML web a spider would retrieve a URL, tokenize the content and add it to an index. It would collect any links found in the content and queue them to be retrieved and tokenized next. That's the simple version. To improve and simplify crawling several additional document types were developed for publication by websites. These include sitemaps and the robots.txt. The sitemap's job was to quickly identify the content available on the site and the robots.txt was the rules a crawler or spider should follow to remain polite. The Markdown Web provides an additional document, `/.well-known/toc.opml`. These three documents can provide enough to safely index a Markdown Web site or HTML Web site. A lightweight, Markdown Web oriented search engine could provide such a crawler and that could be used to index sites and provide a web service suitable for a Markdown Web browser like BonBon.

## Taking things a step further

I opened this post mentioning browser side search enabled by PageFind. We can take a page from PageFind and publish indexes along side our Markdown content. If a browser like [BonBon](https://github.com/scripting/bonBon "GitHub repository for BonBon, HTML") or [CMarkFind](https://rsdoiel.github.io/cmarkfind/index.md "Documentation on CMarkFind") is capable of using those indexes it could hold the search engine core to provide site search directly in the browser.

Publicly published indexes can also be aggregated across sites. This would allow you to build a personalize search engine right in your browser for sites that publish their own indexes. It could also allow you to run a personal search engine for the Markdown Web sites you track. When you consider that Cloudflare sites publish Markdown for the HTML content, there is a large corpus of Markdown content on the web that could be included in your personal search engine.

I think there is an incentive for sites to publish their own indexes. We've seen this in site searches and the adoption of PageFind. First you control what gets indexed on your site. Second they control when the site is index. If you index as part of your publication workflow your site's indexes are always up to date. You don't wait on services like DuckDuckGo, Google, Bing et el. to catch up with your site's updates. The browser side search engine can use a manifest to determine if it needs to retrieve a fresh index or if it could use the one it cached previously. A search engine service indexer can use that same manifist to make sure they're up to date too. They even can point at your published copies rather than coping the indexes to the local system.

## But wait, no one publishes there indexes today!

We have a chicken and egg problem for our public index ecosystem. There are no published indexes to use in my browser's search engine today (November 26, 2026). Some sites may never publish indexes. How do we handle the bootstrap and sites that don't host public index sets? We fall back to the traditional way web search engines work. We use the sitemaps, robots.txt and the new toc.opml to identify what could be index. We could even use RSS feeds that have source markdown elements that can be indexed. We retrieve the Markdown documents and index them locally. Even our browser's bookmarks can be leveraged. This could be done by the browser for small sized Markdown Web sites. Larger sites would need a tool so you don't leave your browser running all the time. It's a solvable problem.

## Key points

The browser would be responsible presenting the UI needed to run a search query. The search could be a single site or cross site based on the index sets available locally or remotely. Search can also be a service provided at a known URL. This aligns well with the writer and reader paradigms of the Markdown Web. The Open Search Description Format XML or JSON file provides enough information for a browser to form the search query. Search results are just Markdown documents when produced by search engine. A browser embedded search could choose to use Markdown or any other useful UI (say something integrate into the Bookmark menu system). By standardizing the index format and schema the search engine could be implemented directly in the browser, as a local service or a remote Markdown Web service. Plenty of flexibility.

I've started an experiment, [CMarkFind](https://rsdoiel.github.io/cmarkfind/index.md) to explore this idea. Hopefully others will attempt something similar. In the meantime I'll be developing my personal search engine for the Markdown Web. If you have ideas, suggestion or other feedback you can open an issue at <https://github.com/rsdoiel/cmarkfind/issues>.




