diff --git a/R/build-home-index.R b/R/build-home-index.R index 2a3e6de4d..ea07966d0 100644 --- a/R/build-home-index.R +++ b/R/build-home-index.R @@ -67,11 +67,9 @@ data_home_sidebar <- function(pkg = ".", call = caller_env()) { rel_html_path <- fs::path_rel(html_path, pkg$src_path) config_abort( pkg, - "Path specified in {.field home.sidebar.html} ({.file {rel_html_path}}) doesn't exist.", + "{.field home.sidebar.html} specifies a file that doesn't exist ({.file {rel_html_path}}).", call = call ) - - } return(read_file(html_path)) } diff --git a/R/navbar.R b/R/navbar.R index f03bf6e50..7c1ce79c7 100644 --- a/R/navbar.R +++ b/R/navbar.R @@ -68,7 +68,7 @@ render_navbar_links <- function(x, depth = 0L, pkg) { if (!is.list(x)) { config_abort( pkg, - "Invalid navbar specification.", + "{.field navbar} is incorrectly specified.", call = quote(data_template()) ) } diff --git a/R/pkgdown.R b/R/pkgdown.R index 96e1c292b..0a0b5e7fb 100644 --- a/R/pkgdown.R +++ b/R/pkgdown.R @@ -62,7 +62,6 @@ local_pkgdown_template_pkg <- function(path = NULL, meta = NULL, env = parent.fr desc$set("Package", "templatepackage") desc$set("Title", "A test template package") desc$write(file = file.path(path, "DESCRIPTION")) - file.create(path(path, "_pkgdown.yaml")) } if (!is.null(meta)) { diff --git a/tests/testthat/_snaps/build-home-index.md b/tests/testthat/_snaps/build-home-index.md index d5038ecbb..67e283fce 100644 --- a/tests/testthat/_snaps/build-home-index.md +++ b/tests/testthat/_snaps/build-home-index.md @@ -48,7 +48,7 @@ # data_home_sidebar() errors well when no HTML file - Path specified in home.sidebar.html ('file.html') doesn't exist. + home.sidebar.html specifies a file that doesn't exist ('file.html'). i Edit _pkgdown.yml to fix the problem. # data_home_sidebar() can get a custom markdown formatted component diff --git a/tests/testthat/_snaps/navbar.md b/tests/testthat/_snaps/navbar.md index ca494f493..2e000c286 100644 --- a/tests/testthat/_snaps/navbar.md +++ b/tests/testthat/_snaps/navbar.md @@ -189,7 +189,7 @@ data_navbar(pkg) Condition Error in `data_template()`: - ! Invalid navbar specification. + ! navbar is incorrectly specified. i Edit _pkgdown.yml to fix the problem. # render_navbar_links BS3 & BS4 default