Skip to content

docs: verify docs site with Algolia #1328

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

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

chewong
Copy link
Collaborator

@chewong chewong commented Jul 29, 2025

Reason for Change:

Currently, the search function in the docs site is not working because Algolia wasn't able to verify the ownership of the site domain.

image

Per https://www.algolia.com/doc/tools/crawler/getting-started/create-crawler/#verify-your-domain, we can verify the domain by adding a <meta> HTML tag with specific content. I've added the site verification payload as a repository secret:

image

Testing

image

Issue Fixed:

Follow-up for #1197

Notes for Reviewers:

Copy link

Title

Add Algolia site verification for docs


Description

  • Added Algolia site verification meta tag to docusaurus.config.js.

  • Updated .github/workflows/deploy-docs.yml to include ALGOLIA_SITE_VERIFICATION environment variable.


Changes walkthrough 📝

Relevant files
Enhancement
docusaurus.config.js
Add Algolia site verification meta tag                                     

website/docusaurus.config.js

  • Added headTags array to include Algolia site verification meta tag.
  • Used environment variable ALGOLIA_SITE_VERIFICATION with a fallback to
    DUMMY_ALGOLIA_SITE_VERIFICATION.
  • +12/-0   
    deploy-docs.yml
    Add ALGOLIA_SITE_VERIFICATION to deploy workflow                 

    .github/workflows/deploy-docs.yml

  • Included ALGOLIA_SITE_VERIFICATION in the environment variables for
    the build step.
  • +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Environment Variable Usage

    The process.env.ALGOLIA_SITE_VERIFICATION environment variable is used directly in the configuration. Ensure that this variable is set correctly in all environments where the site is deployed.

    content: process.env.ALGOLIA_SITE_VERIFICATION || "DUMMY_ALGOLIA_SITE_VERIFICATION",

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Remove dummy verification

    Avoid using a dummy value for ALGOLIA_SITE_VERIFICATION. Ensure that the environment
    variable is always set.

    website/docusaurus.config.js [22]

    -content: process.env.ALGOLIA_SITE_VERIFICATION || "DUMMY_ALGOLIA_SITE_VERIFICATION",
    +content: process.env.ALGOLIA_SITE_VERIFICATION,
    Suggestion importance[1-10]: 7

    __

    Why: Removing the dummy value ensures that the environment variable is always used, improving the reliability of the configuration. However, this change alone does not address what happens if the environment variable is not set, so it does not warrant a higher score.

    Medium

    Signed-off-by: Ernest Wong <chwong719@gmail.com>
    @Fei-Guo
    Copy link
    Collaborator

    Fei-Guo commented Jul 30, 2025

    A side note, do you think if it is a good idea to provide a search functionality using a Kaito inference server?

    @chewong
    Copy link
    Collaborator Author

    chewong commented Jul 30, 2025

    Successfully verified the site locally:

    image

    A side note, do you think if it is a good idea to provide a search functionality using a Kaito inference server?

    @Fei-Guo Yes I think it's a good idea. If we have an expert on frontend development, we can try to do it with https://docusaurus.io/docs/markdown-features/react

    @chewong chewong merged commit 4a75426 into kaito-project:main Jul 30, 2025
    12 of 14 checks passed
    @chewong chewong deleted the algolia-site-verification branch July 30, 2025 23:21
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: Done
    Development

    Successfully merging this pull request may close these issues.

    3 participants