Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Namespace links created for non-existing parent namespaces #10588

Open
robtimus opened this issue Mar 11, 2025 · 0 comments
Open

[Bug] Namespace links created for non-existing parent namespaces #10588

robtimus opened this issue Mar 11, 2025 · 0 comments
Labels
template The stock site template

Comments

@robtimus
Copy link

Describe the bug
For types, the generated pages contain a Namespace value. This consists of several links. However, this does not respect the project's RootNamespace anymore since version 2.65.2. Instead it creates a link for each namespace part, including non-existing parent namespaces. For instance, if my root namespace is Foo.Bar.Baz, the namespace contains the following links:

  • Foo -> Foo.html
  • Bar -> Foo.Bar.html
  • Baz -> Foo.Bar.Baz.html

The problem is that Foo.html and Foo.Bar.html don't exist, leading to 404 errors.

Maybe I'm missing some configuration, but I tried several options including globalNamespaceId but the issue is not fixed. Downgrading to version 2.65.1 isn't possible because of #9047 and #9153.

To Reproduce
Minimal docfx.json:

{
  "metadata": [
    {
      "src": [
        {
          "files": [
            "**.csproj"
          ],
          "src": "../Foo.Bar.Baz"
        }
      ],
      "dest": "api"
    }
  ],
  "build": {
    "content": [
      {
        "files": [
          "api/**.yml"
        ]
      },
      {
        "files": [
          "toc.yml"
        ]
      }
    ],
    "dest": "_site"
  }
}

The Foo.Bar.Baz project descriptor contains this:

<RootNamespace>Foo.Bar.Baz</RootNamespace>

Run docfx docfx.json from the directory where docfx.json is located.
This successfully generates the API pages but with the invalid links.

Expected behavior

  • Foo is not a link
  • Bar is not a link
  • Baz is a link to Foo.Bar.Baz.html

Screenshots
Generated using version 2.65.1:
Image

Generated using the latest version:
Image

Context (please complete the following information):

  • Docfx version: 2.78.3
  • Template: default
@robtimus robtimus added the template The stock site template label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template The stock site template
Projects
None yet
Development

No branches or pull requests

1 participant