Skip to content
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

Deprecate BS3 #2545

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
hadley marked this conversation as resolved.
Show resolved Hide resolved
* `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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be visible in CI logs? should there be more info, a new short blog post maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to think more about how to expose the sitrep more clearly in automated checks.

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
Loading