-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add version switcher to the site #575
Merged
Merged
Commits on May 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e186975 - Browse repository at this point
Copy the full SHA e186975View commit details -
This script provides a function for building a pkgdown site with multiple versions. Versions are defined by: - ref - a git ref to build. In the gist, prefix tags with `refs/tags/` and branches with `refs/remotes/origin/` - href - a URL path where the version will be available at - label - a label to display in a version switcher. Using true will take version from DESCRIPTION and append "(dev)" suffix The script works as follows: 1. Copy repository into a temporary directory 2. Read `pkgdown/navbar_template.html` and populate switcher options with versions 3. For every version*: a. Create a git worktree based on version's ref b. Populate the navbar template with current version's label c. Write the navbar template to `pkgdown/templates/navbar.html` relative to the git worktree d. Copy `pkgdown/extra.css` from the repository we are building out of (this ensures a consistent and up-to-date styling) e. Use pkgdown to build site f. Remove the worktree * Version with "/" href will be built first. This avoids an error from pkgdown regarding building the site to a non-empty directory (that's not managed by pkgdown). The resulting build has the site with "/" href in the destination directory. Respective versions are stored in subdirectories named after labels defining versions. Known issues - Every version has its own `sitemap.xml` - Every version has separate assets (Bootstrap, favicons, ...) - All versions are indexed by search engines - None of the versions has canonical URLs - "Source" link in vignettes and function reference is hardcoded to HEAD (instead of a respective version) - Switching a version redirects to index (instead of staying on the same subpage in target version if it exists)
Configuration menu - View commit details
-
Copy full SHA for 5e3ef7d - Browse repository at this point
Copy the full SHA 5e3ef7dView commit details -
This change pins bslib version to 0.5.1 to keep Bootstrap 5.2.2. Switching to a newer bslib (and Bootstrap) version requires fixing CSS.
Configuration menu - View commit details
-
Copy full SHA for 08e453d - Browse repository at this point
Copy the full SHA 08e453dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d1ee335 - Browse repository at this point
Copy the full SHA d1ee335View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d9ac99 - Browse repository at this point
Copy the full SHA 6d9ac99View commit details
Commits on Jun 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c023a42 - Browse repository at this point
Copy the full SHA c023a42View commit details
Commits on Jun 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 76ce207 - Browse repository at this point
Copy the full SHA 76ce207View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33ca67e - Browse repository at this point
Copy the full SHA 33ca67eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8310d15 - Browse repository at this point
Copy the full SHA 8310d15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8afbcba - Browse repository at this point
Copy the full SHA 8afbcbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd5a656 - Browse repository at this point
Copy the full SHA fd5a656View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.