-
Notifications
You must be signed in to change notification settings - Fork 321
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
BS4: box search not working #1770
Comments
I just looked into the js console after attempting a search on your site. It says that
The index.json is available at https://dieghernan.github.io/rogtemplate/search.json, so it is looking at the wrong directory. |
👋 @dieghernan & @GregorDeCillia! I think the problem is simply that the URL is missing from the configuration file, I opened a PR rOpenGov/rogtemplate#1 (re-open this issue if not). The function I'll add a mention of this to the docs of |
Thanls @maelle @GregorDeCillia, I think I found the root cause of the issue: The current in-development template line for pkgdown/inst/templates/BS4/navbar.html Line 20 in 705ff7c
So basically: data-search-index="{{{search-index}}}" This differs of how other hihg-level assets are treated in the package, see pkgdown/inst/templates/BS4/head.html Line 42 in 705ff7c
I created a custom See results: https://dieghernan.github.io/rogtemplate/ Note that I tried "{{#site}}{{root}}{{/site}}{{{search-index}}}"` but it didn't work!. I think this is due to the Line 50 in 9ce6af4
Note that other similar resources don't have the leading slash: pkgdown/inst/templates/BS4/head.html Lines 13 to 18 in 705ff7c
PS: I am missing the GitHub link, that should be displayed by default: https://pkgdown.r-lib.org/dev/articles/customization.html?q=navbar#navbar-1
May I open a new issue? |
Thanks for sharing this. It makes sense that this should not be due to missing links in About the GitHub LinkI think you need your repo url in the DESCRIPTION so that pkgdown knows the target for the source-link. See https://pkgdown.r-lib.org/articles/linking.html |
Thanks @GregorDeCillia now it's working. May I suggest to reopen this issue until is completely solved? |
Oh, good catch and sorry for the false resolution! The problem is that the past link was relative to the website root which for e.g. pkgdown's own website is fine, but in the case of your GitHub pages website was not. 🤦♀️ I'll make a fix. Thanks for your patience 😉 |
Thank you @maelle I'll test this with https://statistikat.github.io/STATcubeR/dev/ as soon as the PR is in pkgdown@master. I guess this is the same issue
|
Thanks @maelle , now it is working with the |
🎉 thanks for the update, and thanks again for reporting the issue! |
The new version now also finds the search index for my package. However, clicking into a search result leads to a 404. Example:
This navigates to https://dieghernan.github.io/LICENSE.html?q=mit#mit-license (404) but it should be https://dieghernan.github.io/rogtemplate/LICENSE.html?q=mit#mit-license |
Thank you! Wrong assumption on what the root is, again. I'll PR a fix of the search index building. |
Here we go again: #1774 🙂 I'll come back to this thread next week. |
Thanks @maelle @GregorDeCillia @hadley , now is working fine in https://dieghernan.github.io/rogtemplate/ |
Hi,
I am testing the in-development version of
pkgdown
for creating a template (uses BS4) and the search box doesn’t seem to work:Web: https://dieghernan.github.io/rogtemplate/index.html
Source: https://github.com/dieghernan/rogtemplate
The funny thing is that it seems to work locally, so my first guess is that it should be related with relative/absolute paths.
Am I missing something?
Regards
The text was updated successfully, but these errors were encountered: