Search code examples
mkdocs

what is the correct way to add external url in mkdocs


I tried this but didn't work, it still showing the index page, what is the correct way?

nav:
  - Home: index.md
  - 'Document': 'https://www.google.com/'

Solution

  • It should be automatically inferring that it is an external link, per the documentation:

    Any path which is not found in the files is assumed to be an external link.

    Have you tried it without the www, adding quotes around the index.md (although I'm not sure why that would work), and/or modifying your indents? Those are the only differences I can notice between yours and the example:

    nav:
        - Introduction: 'index.md'
        - 'about.md'
        - 'Issue Tracker': 'https://example.com/'