sample search implementation#589
Conversation
Added Algolia site verification and DocSearch integration. Signed-off-by: Nigel Brown <pnigelbrown@gmail.com>
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesAlgolia DocSearch Integration
Assessment against linked issues
Out-of-scope changesNo out-of-scope changes found. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@templates/default.html`:
- Around line 1-4: The DocSearch head block is rendering before the document
doctype, so move the existing head contents from the top of the template into
the actual <head> section after <!DOCTYPE html>. Keep the unique `block head`
content (`@docsearch/css@4` stylesheet link and `algolia-site-verification`
meta) inside the page’s `<head>` so `<!DOCTYPE html>` remains the first rendered
token.
- Line 2: The DocSearch assets are loaded from floating major CDN URLs without
integrity protection, so update the stylesheet and script tags in the default
template to use pinned exact versions for both `@docsearch/css` and `@docsearch/js`,
and add matching integrity plus crossorigin="anonymous" attributes on each tag.
Locate the existing DocSearch includes in the default HTML template and make the
same change for both asset references so the loaded content is fixed and
verifiable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: dd79c8e5-b3fd-409c-8e4c-a788424d625d
📒 Files selected for processing (1)
templates/default.html
| {%- block head -%} | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4" /> | ||
| <meta name="algolia-site-verification" content="D96477DE35118476" /> | ||
| {%- endblock -%}<!DOCTYPE html> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep <!DOCTYPE html> as the first rendered token.
Line 4 currently emits the doctype after the new DocSearch <link> and verification <meta>, which violates doctype-first and can affect document parsing. Move this block into the actual <head> after the doctype.
Proposed placement
-{%- block head -%}
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4" />
- <meta name="algolia-site-verification" content="D96477DE35118476" />
-{%- endblock -%}<!DOCTYPE html>
+<!DOCTYPE html>Then place the block contents inside the existing <head> element.
🧰 Tools
🪛 HTMLHint (1.9.2)
[error] 1-1: Doctype must be declared before any non-comment content.
(doctype-first)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@templates/default.html` around lines 1 - 4, The DocSearch head block is
rendering before the document doctype, so move the existing head contents from
the top of the template into the actual <head> section after <!DOCTYPE html>.
Keep the unique `block head` content (`@docsearch/css@4` stylesheet link and
`algolia-site-verification` meta) inside the page’s `<head>` so `<!DOCTYPE
html>` remains the first rendered token.
Source: Linters/SAST tools
| @@ -1,4 +1,7 @@ | |||
| {%- block head -%}{%- endblock -%}<!DOCTYPE html> | |||
| {%- block head -%} | |||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@4" /> | |||
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
: "${DOCSEARCH_VERSION:?Set an exact DocSearch version, e.g. 4.x.y}"
for pkg in css js; do
url="https://cdn.jsdelivr.net/npm/@docsearch/${pkg}@${DOCSEARCH_VERSION}"
hash="$(curl -fsSL "$url" | openssl dgst -sha384 -binary | openssl base64 -A)"
printf '%s\nintegrity="sha384-%s"\n\n' "$url" "$hash"
doneRepository: valkey-io/valkey-io.github.io
Length of output: 243
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the template and find DocSearch references.
git ls-files templates/default.html
nl -ba templates/default.html | sed -n '1,220p'
printf '\n--- docsearch refs ---\n'
rg -n '`@docsearch`|jsdelivr|integrity|crossorigin' templates/default.htmlRepository: valkey-io/valkey-io.github.io
Length of output: 230
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- templates/default.html ---'
cat -n templates/default.html | sed -n '1,220p'
printf '\n%s\n' '--- docsearch refs ---'
rg -n '`@docsearch`|jsdelivr|integrity|crossorigin' templates/default.htmlRepository: valkey-io/valkey-io.github.io
Length of output: 7926
Pin the DocSearch CDN assets.
@docsearch/css@4 and @docsearch/js@4 are loaded from floating major URLs without SRI. Use exact versions and add integrity plus crossorigin="anonymous" on both tags so upstream CDN/package changes can’t alter every page. (templates/default.html:2,145)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@templates/default.html` at line 2, The DocSearch assets are loaded from
floating major CDN URLs without integrity protection, so update the stylesheet
and script tags in the default template to use pinned exact versions for both
`@docsearch/css` and `@docsearch/js`, and add matching integrity plus
crossorigin="anonymous" attributes on each tag. Locate the existing DocSearch
includes in the default HTML template and make the same change for both asset
references so the loaded content is fixed and verifiable.
|
Removed unused stylesheet and meta verification from head block. Signed-off-by: Nigel Brown <pnigelbrown@gmail.com>
Signed-off-by: Nigel Brown <pnigelbrown@gmail.com>
Added Algolia site verification and DocSearch integration.
Description
Adds a sample search implementation
Keys are search only and specific to this reference implementation will be rotated for account managing algolia application
Issues Resolved
closes #81
Check List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the BSD-3-Clause License.