Skip to content

Incorrect reference link/page generation for object Foo when package is also named foo #2987

@arnaudgallou

Description

@arnaudgallou

When using pkgdown::site_build() locally for a package named foo that documents and exports an object named Foo (note the case of the first letter), the link in the Reference tab for that object points to:

https://user.github.io/foo/dev/reference/foo-package.html

instead of the correct local topic page:

file:///me/foo/docs/dev/reference/foo.html

This is what the generated docs/dev/reference/Foo.html file looks like:

<html>
  <head>
    <meta http-equiv="refresh" content="0;URL=https://user.github.io/foo/dev/reference/foo-package.html" />
    <meta name="robots" content="noindex">
    <link rel="canonical" href="https://user.github.io/foo/dev/reference/foo-package.html">
  </head>
</html>

This is a problem that only occurs when running the site locally. Renaming the object to foo (all lower case) fixes the problem.


The issue can be replicated with my package plume that exports an R6 class named Plume. The pkgdown version doesn't seem to matter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions