docs: index all 14 exports in pkgdown, set the site url
The reference index covered 6 of 14 exports, so pkgdown errored on the eight missing topics and the docs site did not build at all. Adds a Comparison & aggregation section and a Corpus metadata section, lists both vignettes as articles, and sets url so canonical links and search resolve. build_site() now completes clean: reference metadata ok, no problems.
This commit is contained in:
@@ -131,3 +131,17 @@ test_that("vignettes are not excluded from the build", {
|
||||
# r-universe and GitHub Actions. It must never be excluded.
|
||||
expect_false(any(grepl("fixture_corpus", ignore, fixed = TRUE)))
|
||||
})
|
||||
|
||||
test_that("_pkgdown.yml indexes every exported topic", {
|
||||
skip_if_no_source_tree("_pkgdown.yml", "NAMESPACE")
|
||||
exports <- grep("^export\\(", readLines(source_tree_path("NAMESPACE"), warn = FALSE),
|
||||
value = TRUE)
|
||||
exports <- sub("^export\\((.*)\\)$", "\\1", exports)
|
||||
yml <- paste(readLines(source_tree_path("_pkgdown.yml"), warn = FALSE), collapse = "\n")
|
||||
missing <- exports[!vapply(exports,
|
||||
function(e) grepl(paste0("\\b", e, "\\b"), yml),
|
||||
logical(1))]
|
||||
# pkgdown errors on topics missing from the index, so an unlisted export
|
||||
# means the docs site does not build at all.
|
||||
expect_equal(missing, character(0))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user