dotnet / dotnet/docfx

[Bug] DocFx is not working with multiple projects with seperate metadata

Open
#9,371 2 comments 0 reactions 0 assignees View on GitHub
toc
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**Describe the bug**
When docfx.json has multiple projects added, the generated toc.html file is incorrect.
Eg. docfx.json
```
{
"metadata": [
{
"src": [
{
"src": "../..",
"files": [
"RailwayOrientedProgramming/src/RailwayOrientedProgramming.csproj"
]
}
],
"dest": "api/rop"
},
{
"src": [
{
"src": "../..",
"files": [
"DomainDrivenDesign/src/DomainDrivenDesign.csproj"
]
}
],
"dest": "api/domain"
},
```

**To Reproduce**
Steps to reproduce the behavior:
1. Clone repro https://github.com/xavierjohn/FunctionalDDD.git
2. checkout branch `docfx_multiple_projects_not_working`
3. go to folder docs and run `hostdoclocally.cmd`

Note the generated HTML file has the same incorrect **href** with the same value. The **name** and **title** attributes are correct.
FunctionalDDD\docs\docfx_project\_site\api\toc.html
```


  • Railway Oriented Programming


  • Domain Driven Design


  • Common Value Objects


  • ASP Extensions


  • Fluent Validation

  • ```

    **Expected behavior**
    The generated html file should have the correct href set
    eg.
    ```


  • Railway Oriented Programming


  • Domain Driven Design


  • Common Value Objects


  • ASP Extensions


  • Fluent Validation

  • ```

    **Context (please complete the following information):**
    - OS: Windows
    - Docfx version: 2.70.3+3968fc5e92ebc2e4a2d97df0105000af2ec7eb82

    **Additional context**
    I am trying to add a level for each of my assembly in the documentation.
    Similar to this issue https://github.com/dotnet/docfx/issues/1711

    Contributor guide

    Open the contributing guide

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.