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.
Changes
Closes #601.
The
pkgdown/build.R
script used to replace thenavbar.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.