Fix search#678
Conversation
✅ Deploy Preview for docs-rapids-ai ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
| function initSearch() { | ||
| var request = new XMLHttpRequest(); | ||
| request.open('GET', '{{ "assets/js/search-data.json" | absolute_url }}', true); | ||
| request.open('GET', '/assets/js/search-data.json', true); |
There was a problem hiding this comment.
This change is needed to avoid cross-site requests (which fail) between the testing site (like https://deploy-preview-678--docs-rapids-ai.netlify.app/) and the main site (https://docs.rapids.ai). Otherwise our search data fails to load on the site previews.
| --- | ||
| --- | ||
| // SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. | ||
| // All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| --- | ||
| --- |
There was a problem hiding this comment.
This is the primary fix needed here. I think the inclusion of the copyright notice comments causes the Jekyll template engine not to trigger. You can see that currently, https://docs.rapids.ai/assets/js/just-the-docs.js appears to have raw template content. Moving the --- up above the copyright notice comments appears to fix it.
| slack: | ||
| name: Slack | ||
| url: https://join.slack.com/t/rapids-goai/shared_invite/zt-trnsul8g-Sblci8dk6dIoEeGpoFcFOQ | ||
| url: https://rapids.ai/slack-invite |
There was a problem hiding this comment.
Unrelated fix -- just something we've standardized in most places that I noticed while looking over the config.
ncclementi
left a comment
There was a problem hiding this comment.
Thanks @bdice
There is one thing I'm not sure if it is a consequence of this PR or if it is part of the preview feature. But when if try to access on the preview link https://deploy-preview-678--docs-rapids-ai.netlify.app/api/ any of the API docs, it leads to a Page Not Found. Is that a known issue?
If that's not a consequence of this PR, I'm happy to merge and then open a separate issue, about it.
Separate note, but we can open another issue about this too. When we are searching something like cudf or cuml, the first hits are not the reference to the API docs. I wonder if tehre is a way to make sure this is the first hit. For example:
|
Good questions. The preview site does not actually include the API docs. Just the Markdown pages in this repo. It's expected that those are broken. Similarly, the search data only indexes the pages in this repo. I don't know if there is a good way to manually inject items into the search index (or tweak the search priority) as you're asking. I am going to merge this for now to unbreak search, but if you're interested in pursuing those other ideas, issues are welcome! |
#642 broke the syntax in
assets/js/just-the-docs.js. This fixes it.Closes #677.