diff --git a/NEWS.md b/NEWS.md index 49f5a3164..ac60badb2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # pkgdown (development version) +* Automatic links to reference pages were generated incorrectly if the + `\name{}` entry in the `*.Rd` file didn't match the filename + (@dmurdoch, #1586). + * New "Customize your pkgdown website" vignette (#1573). * Added extension points to make HTML widgets (and RGL in particular) work diff --git a/R/context.R b/R/context.R index a4534cb0f..fc18ce7ea 100644 --- a/R/context.R +++ b/R/context.R @@ -10,7 +10,8 @@ section_init <- function(pkg, depth, override = list(), .frame = parent.frame()) local_options_link <- function(pkg, depth, .frame = parent.frame()) { article_index <- set_names(path_file(pkg$vignettes$file_out), pkg$vignettes$name) - topic_index <- invert_index(set_names(pkg$topics$alias, pkg$topics$name)) + Rdname <- fs::path_ext_remove(pkg$topic$file_in) + topic_index <- invert_index(set_names(pkg$topics$alias, Rdname)) withr::local_options( list(