Skip to content

MkDocs warning for anchor link in nav even when the link works #4026

Open

Description

@ashishguptaiitb

When I add a TOC link to a H2, I see a warning during the build. However, the link works in the published article.

The YAML entry looks like:
- Heading2: filename-without-MD-extn/#anchor-to-h2

This works in the published TOC but I see the following warning while building:
WARNING - A reference to filename-without-MD-extn/#anchor-to-h2 is included in the nav configuration, which is not found in the documentation files

In the interest of having a clean, warning-free build (to use strict mode), how can I suppress this warning or get rid of it?

I tried adding the extension .md to the nav entry as below, but it stopped working in published TOC and the warning still remained.
- Heading2: filename-without-MD-extn.md/#anchor-to-h2

Also, while searching in the issues, I came across this comment in issue #3223 which may be relevant to the above issue.

Activity

  1. ashishguptaiitb commented on Dec 5, 2025

    @ashishguptaiitb
    Author

    Following up on this issue. Is it possible to downgrade such a warning to info. I'd like to have this along with strict mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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