Skip to content

refactor: consolidate Algolia search logic into algolia-search.js#823

Open
anuj452005 wants to merge 1 commit intoprecice:masterfrom
anuj452005:refactor/consolidate-algolia-search
Open

refactor: consolidate Algolia search logic into algolia-search.js#823
anuj452005 wants to merge 1 commit intoprecice:masterfrom
anuj452005:refactor/consolidate-algolia-search

Conversation

@anuj452005
Copy link

Summary

Consolidates the Algolia search implementation into a single file,
eliminating duplicate logic between _includes/algolia.html and
js/algolia-search.js.

Problem

The search logic existed in two places:

  • _includes/algolia.html — active inline implementation (used in production)
  • js/algolia-search.js — unused external file with outdated logic

This violated the single source of truth principle, prevented browser
caching of the search JS, and added unnecessary complexity to the layout template.

Changes

  • _includes/algolia.html: Reduced to a single <script src> tag
  • js/algolia-search.js: Now the canonical implementation, updated with:
    • Dynamic keyboard shortcut placeholder (⌘K / Ctrl+K)
    • Escape-key handler (ported from the recent improvement in algolia.html)
    • Jekyll front matter for Liquid variable processing

No functional changes intended

Search behavior, keyboard shortcuts, and UI remain identical.
This is a structural refactor only.

Testing

  • Site runs locally with bundle exec jekyll serve -l

closes #796

@MakisH MakisH added technical Technical issues on the website GSoC Contributed in the context of the Google Summer of Code labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code technical Technical issues on the website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Algolia search to use external js/algolia-search.js (remove duplicate inline implementation)

2 participants