Search Extension

Build-time search index generation from rendered pages and discovered links.

webifier.search does not render a visible section by itself. It registers an after_build hook that writes search.json from pages and links gathered during rendering.

Search is intentionally documented separately from the current site navbar because the search UI is still evolving. The extension-level idea is stable: collect searchable content at build time, then let a frontend UI consume the generated index.

config:
  webifier:
    extensions:
      site:
        uses: webifier.standard
      search:
        uses: webifier.search
        content: true
        links: true
        ui: true

Instance options:

  • content: include page body text in the search index.
  • links: include rendered/discovered links in the search index.
  • ui: reserved for search UI integration.

Search-like extensions usually use after_build because they need the final graph of rendered pages.

class SearchExtension(Extension):
    id = "webifier.search"

    def register(self, ctx):
        super().register(ctx)
        ctx.add_hook("after_build", self.save_search_index)

Custom search extensions can write alternate indexes, enrich entries with embeddings, or export a format expected by a hosted search provider. Register an after_build hook when you need the completed page graph.