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

Absolute URL in search index #1774

Merged
merged 4 commits into from Sep 21, 2021
Merged

Absolute URL in search index #1774

merged 4 commits into from Sep 21, 2021

Conversation

maelle
Copy link
Collaborator

@maelle maelle commented Sep 17, 2021

Fix #1770

Not possible to use the "../" strategy here as the search index is the same for the whole website.

For context, this fixes a wrong assumption about what the root is (not necessarily the production website, e.g. see pkgdown websites hosted on GitHub pages).

@maelle maelle requested a review from hadley September 17, 2021 14:02
@@ -113,6 +113,14 @@ build_search_index <- function(pkg) {

purrr::compact(index)

# Make URLs absolute if possible
url <- pkg$meta$url %||% "/"
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this shouldn't be ""? The url you use in the test doesn't have a trailing slash. Maybe worth testing the case of no default url?

Copy link
Collaborator Author

@maelle maelle Sep 20, 2021

Choose a reason for hiding this comment

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

You were right! I added a test.

In the test I was surprised I had to make sure the file for the two cases was not the same. I think it's because for other snapshot tests, one does not have to worry about overwriting another snapshot. Good to know. 😅

@hadley hadley merged commit 9309673 into master Sep 21, 2021
@hadley hadley deleted the docs-fixfix branch September 21, 2021 17:44
GregorDeCillia added a commit to statistikat/STATcubeR that referenced this pull request Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BS4: box search not working
2 participants