Skip to content

Commit

Permalink
require bslib >= 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Feb 13, 2024
1 parent 3128ffd commit 0b51097
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Description: Generate an attractive and useful website from a source
License: MIT + file LICENSE
URL: https://pkgdown.r-lib.org, https://github.com/r-lib/pkgdown
BugReports: https://github.com/r-lib/pkgdown/issues
Depends:
Depends:
R (>= 3.6)
Imports:
bslib (>= 0.3.1),
Imports:
bslib (>= 0.5.1),
callr (>= 3.7.3),
cli (>= 3.6.1),
desc (>= 1.4.0),
Expand All @@ -40,7 +40,7 @@ Imports:
withr (>= 2.4.3),
xml2 (>= 1.3.1),
yaml
Suggests:
Suggests:
covr,
diffviewer,
evaluate,
Expand All @@ -58,7 +58,7 @@ Suggests:
sass,
testthat (>= 3.1.3),
tools
VignetteBuilder:
VignetteBuilder:
knitr
Config/Needs/website: usethis, servr
Config/potools/style: explicit
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Add Catalan translation (@jmaspons, #2333)
* Set RNG seed for htmlwidgets IDs. This reduces noise in pkgdown reference HTML output when examples generate htmlwidgets (@salim-b, #2294).
* Fix BS5 navbar template to get `navbar.type: dark` to work with bslib 0.6+ / Bootstrap 5.3+ (@tanho63, #2388)
* pkgdown now works better with `{bslib}` >= 0.5.1 (@gadenbuie, #2395)
* pkgdown now requires `{bslib}` >= 0.5.1 (@gadenbuie, #2395)

# pkgdown 2.0.7

Expand Down
21 changes: 7 additions & 14 deletions R/theme.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,12 @@ data_deps_path <- function(pkg) {
bs_theme <- function(pkg = ".") {
pkg <- as_pkgdown(pkg)

theme <- get_bslib_theme(pkg)
bs_theme_args <- pkg$meta$template$bslib
# Theme is passed to bs_theme(bootswatch=) making `preset` redundant
bs_theme_args[["preset"]] <- NULL

bs_theme <- exec(bslib::bs_theme,
version = pkg$bs_version,
bootswatch = theme,
!!!bs_theme_args
)
bs_theme_args <- pkg$meta$template$bslib %||% list()
bs_theme_args[["version"]] <- pkg$bs_version
bs_theme_args[["preset"]] <- get_bslib_theme(pkg)

bs_theme <- exec(bslib::bs_theme, !!!bs_theme_args)

# Drop bs3 compat files added for shiny/RMarkdown
bs_theme <- bslib::bs_remove(bs_theme, "bs3compat")

Expand Down Expand Up @@ -123,10 +119,7 @@ check_bslib_theme <- function(theme, pkg, field = c("template", "bootswatch"), b

bslib_themes <- c(
bslib::bootswatch_themes(bs_version),
if (packageVersion("bslib") >= "0.5.1") {
# bslib >= 0.5.1 provides built-in theme presets
bslib::builtin_themes(bs_version)
},
bslib::builtin_themes(bs_version),
# bs_theme() recognizes both below as bare bootstrap
"default",
"bootstrap"
Expand Down

0 comments on commit 0b51097

Please sign in to comment.