Skip to content

Commit

Permalink
Tweaks based on careful reading
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed May 3, 2024
1 parent 3f62ed5 commit 06e8315
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions R/build-home-index.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion R/navbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
)
}
Expand Down
1 change: 0 additions & 1 deletion R/pkgdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/build-home-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/navbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06e8315

Please sign in to comment.