Skip to content

Commit

Permalink
Deprecate BS3
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed May 14, 2024
1 parent 41fae74 commit fb6d768
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pkgdown (development version)

* Bootstrap 3 has been deprecated. It was superseded in Dec 2021, and now we're starting to more directly encourage folks to move away from it.
* `build_home_index()` now renders math if you use it in your home page (#2263).
* `build_home()` now correctly escapes special HTML characters in the bibtex citation (#2022).
* BS5 templates no longer include empty link to logo when none exists (#2536).
Expand Down
7 changes: 7 additions & 0 deletions R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ pkgdown_sitrep <- function(pkg = ".") {
cli::cli_rule("Sitrep")

pkg <- as_pkgdown(pkg)
if (pkg$bs_version == 3) {
cli::cli_inform(c(
x = "Bootstrap 3 is deprecated; please switch to Bootstrap 5.",
i = "Learn more at {.url https://www.tidyverse.org/blog/2021/12/pkgdown-2-0-0/#bootstrap-5}."
))
}

error_to_sitrep("URLs", check_urls(pkg))
error_to_sitrep("Open graph metadata", data_open_graph(pkg))
error_to_sitrep("Articles metadata", data_articles_index(pkg))
Expand Down
13 changes: 13 additions & 0 deletions tests/testthat/_snaps/check.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# sitrep complains about BS3

Code
pkgdown_sitrep(pkg)
Message
-- Sitrep ----------------------------------------------------------------------
x Bootstrap 3 is deprecated; please switch to Bootstrap 5.
i Learn more at <https://www.tidyverse.org/blog/2021/12/pkgdown-2-0-0/#bootstrap-5>.
v URLs ok.
v Open graph metadata ok.
v Articles metadata ok.
v Reference metadata ok.

# sitrep reports all problems

Code
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-check.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
test_that("sitrep complains about BS3", {
pkg <- local_pkgdown_site(test_path("assets/open-graph"), meta = "
template:
bootstrap: 3
")
expect_snapshot(pkgdown_sitrep(pkg))
})

test_that("sitrep reports all problems", {
pkg <- local_pkgdown_site(test_path("assets/reference"), meta = "
reference:
Expand Down

0 comments on commit fb6d768

Please sign in to comment.