Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing more options to the DocSearch component #2589

Merged
merged 6 commits into from
Nov 9, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Nov 8, 2024

Description

  • This PR exposes a few more of the DocSearch component’s options in the Starlight DocSearch Plugin’s config.
  • We’re still limited to serializable options here, so it’s a subset of DocSearch’s full set of options (which includes stuff like callback methods for transforming results and providing custom UI components).
  • This PR also adds a README to the package which was missing and updates our GitHub labeler action config to apply a 🌟 docsearch label to PRs like this one.
  • I also omitted the initialQuery option for now because it feels like that would perhaps be a mistake to control from a global location like the plugin config. If anything, perhaps it should go through i18n APIs or something else. Seemed safest to omit for now and we can revisit if someone has a specific use case and requests it.
  • We don’t have tests set up for the DocSearch plugin given it’s pretty simple. I tested this by adding the plugin to a local example and testing out the different config options, which worked successfully.

Copy link

changeset-bot bot commented Nov 8, 2024

🦋 Changeset detected

Latest commit: 061b2ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight-docsearch Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the 📚 docs Documentation website changes label Nov 8, 2024
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 061b2ce
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/672f4c28bf71a500080a4610
😎 Deploy Preview https://deploy-preview-2589--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Nov 8, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/site-search.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Nov 8, 2024

size-limit report 📦

Path Size
/index.html 6.14 KB (0%)
/_astro/*.js 22.41 KB (0%)
/_astro/*.css 13.73 KB (0%)

@delucis delucis added the 🌟 docsearch Changes to Starlight’s DocSearch plugin label Nov 8, 2024
Copy link
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

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

Left a small nit related suggestion but other than that, looks good to me 🌟

packages/docsearch/index.ts Outdated Show resolved Hide resolved
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
@delucis delucis merged commit d4cf8cc into main Nov 9, 2024
16 checks passed
@delucis delucis deleted the chris/expand-docsearch-options branch November 9, 2024 11:52
@astrobot-houston astrobot-houston mentioned this pull request Nov 9, 2024
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Nov 11, 2024
* main: (27 commits)
  i18n(ko-KR): update `site-search.mdx`
  [ci] release (withastro#2590)
  Support passing more options to the DocSearch component (withastro#2589)
  [ci] release (withastro#2587)
  Add changeset for withastro#2252 (withastro#2588)
  [ci] format
  Update dev dependencies (withastro#2582)
  Build performance optimizations for projects with large sidebars (withastro#2252)
  Fix a11y CI workflow (withastro#2503)
  Update `astro-expressive-code` to v0.38 (withastro#2551)
  Added social icon for Nostr (withastro#2579)
  [ci] format
  docs(showcase): add docs.reactbricks.com to showcase (withastro#2586)
  i18n(ja): Update site-search.mdx (withastro#2577)
  i18n(ja): Update pages.mdx (withastro#2576)
  i18n(fr): Update `reference/plugins.mdx` from withastro#2549 (withastro#2574)
  [ci] format
  docs: update showcase-sites.astro (withastro#2562)
  Throw an error if a showcase image does not have the required dimensions (withastro#2573)
  i18n(ja): Update frontmatter.md (withastro#2566)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 docs Documentation website changes 🌟 docsearch Changes to Starlight’s DocSearch plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants