dotnet / dotnet/docfx

[Bug] api/index.md link in toc.yml breaks API docs

Open
#10,334 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Describe the bug**
I prefer my table of contents "API documentation" link to point the page where it shows all the main namespaces instead of going to the first type, i.e. I prefer it to go here:

![Image](https://github.com/user-attachments/assets/a5ab96a4-7b2b-49dd-9b2b-7d8c531c6340)

The problem is that setting up the toc.yml file like this:
```yml
- name: API Documentation
href: api/
```
Goes directly to the first type in the first namespace instead of the view with all the namespaces....so, this *should* work instead:
```yml
- name: API Documentation
href: api/index.md
```
But alas, it does not - when you click the link, it shows blank content and all of the API docs are gone. None of the API docs work, even if you link directly to a member. It breaks the entire site for some reason. Note that `api/index.md` links within markdown documents work just fine.

This works, but it causes `warning InvalidFileLink: Invalid file link:(~/api/index.html)` during docfx build:

```yml
- name: API Documentation
href: api/index.html
```

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.