Skip to content

feat(website): add local blog search - #6073

Merged
Paul Yu (pauldotyu) merged 1 commit into
Azure:masterfrom
pauldotyu:pauldotyu-website-search
Nov 6, 2026
Merged

Paul Yu (pauldotyu) merged 1 commit into
Azure:masterfrom
pauldotyu:pauldotyu-website-search

Conversation

@pauldotyu

Copy link
Copy Markdown
Contributor

Readers need a way to find relevant posts without scanning the full blog listing. The current corpus is small enough for a browser-side index, so search can stay within the existing static deployment without a backend, API keys, or an external crawler.

Approach

  • Add build-time indexing and lazy-loaded browser search with @cmfcmf/docusaurus-search-local.
  • Open the existing search panel from a fixed icon trigger, distinguish article and section results, and preserve direct section navigation without distracting highlights inside articles.
  • Use the existing Font Awesome dependency for consistent search and color-mode icons, with tighter spacing between the icon controls.
  • Document local preview commands and check searches, result pages, section anchors, and index-size budgets in website CI.

The generated default index is approximately 1.76 MiB uncompressed or 460 KiB gzipped. The search panel remains plugin-owned; small theme overrides customize only the icons. Search is available in production builds, not through the development server.

Validation

  • npm run build
  • npm run typecheck
  • npm run test:search (3 passing tests)
  • Browser checks for search navigation, empty results, mobile layout, light and dark modes, fixed trigger sizing, and mouse versus keyboard focus behavior

Release notes

Adds local full-content blog search with article and section results.

- Added `@cmfcmf/docusaurus-search-local` dependency for local search capabilities.
- Created a new `ThemeIcon` component to standardize icon rendering.
- Implemented Dark Mode, Light Mode, and System Color Mode icons using FontAwesome.
- Customized the SearchBar component to integrate the new search icon.
- Enhanced CSS for the navbar search button and search results.
- Added tests for the search functionality to ensure index size and content accuracy.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the browser-side search changes.

No open issues 🎉

1 file not reviewed
  • website/package-lock.json: Generated file
What changed in this PR

Adds browser-side, full-content search to the AKS blog while retaining its static deployment without a search backend or API keys.

Changes:

  • Indexes blog content during production builds and integrates the plugin-owned search panel.
  • Customizes search and color-mode icons, distinguishes article and section results, and hides in-article search highlights.
  • Adds search-index validation to CI and documents local preview commands.
File Description
website/​tests/​search.test.cjs Checks search results, page links, section anchors, and index-size limits.
website/​src/​theme/​SearchBar/​index.tsx Supplies the Font Awesome search-trigger icon.
website/​src/​theme/​Icon/​SystemColorMode/​index.tsx Customizes the system color-mode icon.
website/​src/​theme/​Icon/​LightMode/​index.tsx Customizes the light-mode icon.
website/​src/​theme/​Icon/​DarkMode/​index.tsx Customizes the dark-mode icon.
website/​src/​css/​custom.css Styles the search trigger, result icons, focus states, and navbar spacing.
website/​src/​components/​ThemeIcon.tsx Provides a shared SVG renderer for theme icons.
website/​README.md Documents production-build search previews and validation.
website/​package.json Adds the search plugin and validation command.
website/​package-lock.json Records the search plugin and dependency updates.
website/​docusaurus.config.ts Enables blog-only local search indexing.
.gitignore Excludes the local Impeccable hook cache.
.github/​workflows/​website-publish.yml Validates the search index before publishing.
.github/​workflows/​website-check.yml Validates the search index during PR checks.

Review effort: Balanced

@sanketbakshi1981 sanketbakshi1981 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@sanketbakshi1981 sanketbakshi1981 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@sjwaight Simon Waight (sjwaight) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Search looks good.

@pauldotyu
Paul Yu (pauldotyu) merged commit 1d39b4b into Azure:master Nov 6, 2026
8 checks passed
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.

5 participants