Conversation
|
| Name | Link |
|---|---|
| 🔨 Latest commit | 7b9c927 |
ShaunR1991
left a comment
There was a problem hiding this comment.
Great addition to the website - looking forward to seeing who much better this feels compared to the standard search engine. A few minor points to consider:
-
There’s a small typo in the environment variable DOCSEARCH_API_SERACH_KEY (should be DOCSEARCH_API_SEARCH_KEY).
-
Consider adding a check to ensure the required environment variables are defined before attempting to use them. This will help catch misconfigurations early.
if (!DOCSEARCH_API_ID || !DOCSEARCH_API_SEARCH_KEY || !DOCSEARCH_INDEX_NAME) { console.error("Algolia DocSearch environment variables are not set. Please check your configuration."); process.exit(1); // Exit the process to prevent incomplete setup }
-
What testing have you done of the search functionality? While the integration seems correct, have you validated that the results are displayed as expected, can handle edge cases (such as empty or really long search strings), and can update dynamically without page reloads?
-
Have you got supporting documentation for longevity of the capability? For example, have you documented the need for setting up environment variables, or if there are any specific permissions required for the API keys?
Aside from that, this looks great. Nice work!
Description
I integrated Algolia DocSearch into SplashKit website. The relevant API keys are stored as a enviroment variables and called in the
astro.config.mjsChanges made:
astrojs/starlight-docsearchplugin.astro.config.mjsto include the DocSearch configuration.package.jsonandpackage-lock.jsonto incorporate theastrojs/starlight-docsearchdependency.Dependencies
astrojs/starlight-docsearchas a new dependency.Type of change
Testing Checklist
If modified config files
Folders and Files Added/Modified