Repository navigation
Replace Algolia DocSearch with Pagefind - #6868
patmmccann wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for prebid-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
There was a problem hiding this comment.
💡 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".
…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>
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: afterjekyll build,npx -y pagefind@1.5.2 --site _sitewrites 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 innav.htmlnext to the trigger, so every page with the header gets a working search, including 404 and Credits: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.analytics,api_prebidjs,bidder,example,internal_api_prebidjs,page_v2,pb-video-template,userid,video_sample):.pb-contentgets 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.sectionfilter from the URL: Bidders, Analytics adapters, Modules, Prebid Server, Prebid Mobile, Video, Ad Ops, Prebid.js (including/prebid/and/debugging/), General._includes/pagefind-title.htmlandpagefind-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 likepbjs.renderAd(doc, id, options)are kept whole. The title's punctuation becomes spaces in the weighted copy, sopbjs.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 readspbjs.setConfigas 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._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_filesincludespagefind, sojekyll servekeeps 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):
triggerUserSyncspbjs.bidderSettingspbjs.setConfigThe main weak spot is "native", where the mobile native pages outrank
formats/native.Not in this PR
&& npx -y pagefind@1.5.2 --site _siteto it. I didn't add anetlify.toml, since it would override those settings.🤖 Generated with Claude Code