From 672b8fc2d10d98ed9bab242c2af56662e5983e9b Mon Sep 17 00:00:00 2001 From: dmurdoch Date: Fri, 26 Mar 2021 11:54:08 -0400 Subject: [PATCH] The `\name{}` field in an Rd file shouldn't be used in the topic index (#1586) Fixes #1576 --- NEWS.md | 4 ++++ R/context.R | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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(