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

Use before_navbar to fix the double search box #604

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

kamilzyla
Copy link
Collaborator

@kamilzyla kamilzyla commented Jul 31, 2024

Changes

Closes #601.

The pkgdown/build.R script used to replace the navbar.html template in order to add a documentation version switcher to the navbar. However, this solution broke down when the template was updated in {pkgdown}.

Fix: use template.includes.before_navbar to inject the version switcher instead of overwriting the navbar template. This solution has a chance of being more robust against future updates to the template.

Testing

I have tested this solution in a forked repo and it seems to work fine. See the bot/github-pages branch there.

The `pkgdown/build.R` script used to replace the `navbar.html` template
in order to add a documentation version switcher to the navbar.
However, this solution broke down when the template was updated in {pkgdown}.

Fix: use `template.includes.before_navbar` to inject the version switcher
instead of overwriting the navbar template.
This solution has a chance of being more robust
against future updates to the template.
Copy link
Contributor

@TymekDev TymekDev left a comment

Choose a reason for hiding this comment

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

Nice, looks way better IMO 🚀

@kamilzyla kamilzyla merged commit 5f54d0c into main Aug 1, 2024
10 checks passed
@kamilzyla kamilzyla deleted the fix-double-search-box branch August 1, 2024 11:36
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.

Rhino docs show two search boxes
2 participants