diff --git a/NEWS.md b/NEWS.md index e986b09ca..403ccefd5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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). diff --git a/R/check.R b/R/check.R index ac4ceab03..69761135c 100644 --- a/R/check.R +++ b/R/check.R @@ -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)) diff --git a/tests/testthat/_snaps/check.md b/tests/testthat/_snaps/check.md index 08744c86d..52d533696 100644 --- a/tests/testthat/_snaps/check.md +++ b/tests/testthat/_snaps/check.md @@ -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 . + v URLs ok. + v Open graph metadata ok. + v Articles metadata ok. + v Reference metadata ok. + # sitrep reports all problems Code diff --git a/tests/testthat/test-check.R b/tests/testthat/test-check.R index 4d451f1fa..7a09611d4 100644 --- a/tests/testthat/test-check.R +++ b/tests/testthat/test-check.R @@ -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: