Skip to content

Commit

Permalink
Also set url in use_rdev_pkgdown()
Browse files Browse the repository at this point in the history
  • Loading branch information
jabenninghoff committed Nov 26, 2023
1 parent d14a344 commit 0b13e50
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rdev 1.8.4

* Also set GitHub Pages URL in `use_rdev_pkgdown()`

# rdev 1.8.3

* Check if `pandoc` is in `PATH` on launch (update: `use_rprofile()`)
Expand Down
4 changes: 3 additions & 1 deletion R/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ use_analysis_package <- function(use_quarto = TRUE, prompt = FALSE) {
#' `pkgdown` to fix rendering of GitHub-style
# nolint next: line_length_linter.
#' [task lists](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/about-task-lists),
#' and disables the [bslib::bs_theme()] `"shiny"` preset.
#' adds the GitHub Pages URL, and disables the [bslib::bs_theme()] `"shiny"` preset.
#'
#' @inheritParams usethis::use_pkgdown
#'
Expand All @@ -610,6 +610,8 @@ use_rdev_pkgdown <- function(config_file = "_pkgdown.yml", destdir = "docs") {
fs::dir_create("pkgdown")
usethis::use_template("extra.css", save_as = "pkgdown/extra.css", package = "rdev")
pkg <- yaml::read_yaml(config_file)
urls <- desc::desc_get_urls()
pkg$url <- urls[1]
pkg$template$bslib$preset <- "bootstrap"
# workaround for RStudio race condition
if (rlang::is_interactive()) {
Expand Down
2 changes: 1 addition & 1 deletion man/use_rdev_pkgdown.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/testthat/test-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,12 @@ test_that("use_rdev_pkgdown adds customizations", {

test_that("use_rdev_pkgdown pauses when running interactively", {
pkg <- list(url = NULL, template = list(bootstrap = 5L))
desc_urls <- c("https://example.github.io/package/", "https://github.com/example/package")
mockery::stub(use_rdev_pkgdown, "usethis::use_pkgdown", NULL)
mockery::stub(use_rdev_pkgdown, "fs::dir_create", NULL)
mockery::stub(use_rdev_pkgdown, "usethis::use_template", NULL)
mockery::stub(use_rdev_pkgdown, "yaml::read_yaml", pkg)
mockery::stub(use_rdev_pkgdown, "desc::desc_get_urls", desc_urls)
mockery::stub(use_rdev_pkgdown, "yaml::write_yaml", NULL)

expect_output(
Expand Down

0 comments on commit 0b13e50

Please sign in to comment.