Skip to content

Replace Algolia DocSearch with Pagefind - #6868

Open
patmmccann wants to merge 4 commits into
prebid:masterfrom
patmmccann:agent-pagefind-search
Open

patmmccann wants to merge 4 commits into
prebid:masterfrom
patmmccann:agent-pagefind-search

Conversation

@patmmccann

@patmmccann patmmccann commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #6867.

Replaces Algolia DocSearch with Pagefind, a static search index built from the site at deploy time. No external service or crawler is involved, and the index is rebuilt on every deploy.

Changes

  • .github/workflows/pages-deploy.yml: after jekyll build, npx -y pagefind@1.5.2 --site _site writes the index to _site/pagefind/. It takes about 2 seconds for the ~1,450 pages.
  • _includes/head--common.html, _includes/nav.html: the DocSearch widget is replaced by Pagefind's Component UI. The modal template sits in nav.html next to the trigger, so every page with the header gets a working search, including 404 and Credits:
    • A search button with a Ctrl/Cmd+K shortcut in the header opens a modal with highlighted excerpts, up to 3 section sub-results per page, and a Section filter.
    • A small module script configures ranking (termFrequency: 0.5) before the components connect, then adds the trigger and the modal from a <template>. The trigger is only added when the template is present.
  • Layouts (analytics, api_prebidjs, bidder, example, internal_api_prebidjs, page_v2, pb-video-template, userid, video_sample): .pb-content gets its attributes from the new _includes/pagefind-body.html:
    • data-pagefind-body, so navigation, sidebars and footers aren't indexed. Pages without .pb-content (the home page, 404) aren't indexed.
    • A section filter from the URL: Bidders, Analytics adapters, Modules, Prebid Server, Prebid Mobile, Video, Ad Ops, Prebid.js (including /prebid/ and /debugging/), General.
  • Title boost, _includes/pagefind-title.html and pagefind-body.html: pages with no <h1> in their content, notably the API reference layouts that show the title outside .pb-content, get the page title as weighted hidden text and as the result title. The result title is set from hidden element text (data-pagefind-meta="title"), so titles with commas like pbjs.renderAd(doc, id, options) are kept whole. The title's punctuation becomes spaces in the weighted copy, so pbjs.setConfig(options) ranks first for "setConfig". Without this, Pagefind indexes the title as one word and those pages rank low for their own name. The result title (data-pagefind-meta) keeps the real title, with a hair space (U+200A) after each "." so it still counts as a title match. Pagefind reads pbjs.setConfig as one word, and without the space "setConfig" ranks the page 23rd instead of 1st.
  • .github/workflows/ci.yml: the link-check job builds the index too, so links to /pagefind/ resolve and the index build is tested on every PR.
  • Removed: the DocSearch code and styles (_includes/body-end.html, _sass/components/_search.scss), and the unused legacy search page (search.html, search.json, search/site_search.js), an old Jekyll search over blog posts only.
  • guide.md: the Algolia section is now a Site Search section describing the Pagefind setup. This also fixes the file's existing lint errors, since CI lints the whole file.
  • _config.yml: keep_files includes pagefind, so jekyll serve keeps a locally built index. The README explains how to build it.

Relevance

Measured on this PR's actual Jekyll output: every page of the Netlify deploy preview, indexed with Pagefind 1.5.2 and searched in headless Chrome, and compared with the live Algolia index. On 20 common queries, the expected page is first for 14 and in the top 3 for 18. Some examples (top result):

Query Pagefind Algolia today
floors Price Floors module a bidder page (advergic)
user sync PBS cookie sync, then triggerUserSyncs five bidder pages
gpt pre auction GPT Pre-Auction module GPT Pre-Auction module, then bidder pages
consent management gpp GPP Consent Management module mobile targeting pages
bidderSettings pbjs.bidderSettings Cross Player plugin page
setConfig pbjs.setConfig —

The main weak spot is "native", where the mobile native pages outrank formats/native.

Not in this PR

  • Netlify deploy previews: their build command is set in the Netlify UI, so previews won't have a search index until someone with Netlify access appends && npx -y pagefind@1.5.2 --site _site to it. I didn't add a netlify.toml, since it would override those settings.
  • The Algolia DocSearch account can be closed once this is live.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for prebid-docs-preview ready!

Name Link
🔨 Latest commit 2be642b
🔍 Latest deploy log https://app.netlify.com/projects/prebid-docs-preview/deploys/6adf64b2da40dbba7a39df0f
😎 Deploy Preview https://deploy-preview-6868--prebid-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T22:09:22.220268Z a03ecf7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

A weighted div ranked much lower than a weighted h1 (setConfig: 23rd vs 1st).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a03ecf7a7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread _includes/pagefind-body.html Outdated
Comment thread _includes/pagefind-body.html Outdated
Comment thread _includes/head--common.html Outdated
patmmccann and others added 2 commits October 24, 2026 18:20
…the link check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tyles

- Set the result title from element text, so titles with commas aren't split into metadata keys.
- Classify /prebid/ and /debugging/ pages as Prebid.js in the section filter.
- Ship the modal template in nav.html, next to the trigger, so pages without the footer (404, Credits) get a working search; only add the trigger when the template is present.
- Remove the unused search.html, search.json, search/site_search.js, the DocSearch styles and the now-empty body-end include.
- Update the search section of guide.md (and fix its existing lint errors).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace the search tool

1 participant