Skip to content

Commit

Permalink
Bug fixing on html paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneplusplus committed Nov 1, 2022
1 parent 7a1d52f commit fc49543
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Enhances:
workflowr
URL: https://github.com/kaneplusplus/listdown
BugReports: https://github.com/kaneplusplus/listdown/issues
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
VignetteBuilder: knitr
8 changes: 4 additions & 4 deletions R/build-site.r
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ remove_file_extension <- function(x) {
)
}

#' Create a Minimalist Site YAML List
#' Create a Minimal Site YAML List
#'
#' @param site_name the name of the site.
#' @param tab_name the name of the tabs on the site.
Expand Down Expand Up @@ -243,9 +243,8 @@ ld_build_html_site <-
if (length(data_dir) != 1 && length(data_dir) != length(doc_bundles)) {
stop("The data directory must be a single directory or one per bundle.")
}

if (is.null(site_yaml$output_dir) || site_yaml$output_dir == "") {
site_yaml$output_dir <- html_dir
site_yaml$output_dir <- path_rel(html_dir, rmd_dir)
} else {
warning(paste("Output dir specified in yaml list. The `html_dir`",
"argument will be ignored."))
Expand Down Expand Up @@ -299,10 +298,11 @@ ld_build_html_site <-
render_doc = FALSE)
}
write_yaml(site_yaml, file.path(rmd_dir, "_site.yml"))

if (render_site) {
render_site(rmd_dir, ...)
if (view) {
browseURL(file.path(rmd_dir, html_dir, "index.html"))
browseURL(file.path(rmd_dir, site_yaml$output_dir, "index.html"))
}
}
normalizePath(file.path(html_dir, "index.html"), mustWork = FALSE)
Expand Down
4 changes: 2 additions & 2 deletions man/ld_site_yaml.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-create-html-site.r
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test_that("Site can be built.", {
pages,
site_yaml,
view = TRUE,
quiet = TRUE)
quiet = FALSE)
expect_equal(basename(site_path), "index.html")
})

0 comments on commit fc49543

Please sign in to comment.