Describe the bug
I host a DocFX site and a webapp on two different ports on the same hostname. I added a link to the webapp to the header navigation toc.yml of my DocFX site. Now the link is marked Active on the DocFX homepage, and a breadcrumb with the (external) link is added above the index.html title.
The fix is a one-line change to isExternalHref to mark URLs with different port numbers as external: https://github.com/dotnet/docfx/blob/main/templates/modern/src/helper.ts#L77
Required change: 01d296e
To Reproduce
Steps to reproduce the behavior:
- Create default DocFX site with Modern template
- Add link to http://localhost:1234 to toc.yml
docfx --serve --open-browser
- DocFX treats http://localhost:1234 as identical to http://localhost:8080 and marks the link active
Expected behavior
URLs with different port numbers from the current site should be marked as external and therefore not be active.
Context (please complete the following information):
- Browser: Edge
- Form factor: Desktop
- Docfx version: 2.78.5
- Template: modern
Describe the bug
I host a DocFX site and a webapp on two different ports on the same hostname. I added a link to the webapp to the header navigation
toc.ymlof my DocFX site. Now the link is marked Active on the DocFX homepage, and a breadcrumb with the (external) link is added above the index.html title.The fix is a one-line change to
isExternalHrefto mark URLs with different port numbers as external: https://github.com/dotnet/docfx/blob/main/templates/modern/src/helper.ts#L77Required change: 01d296e
To Reproduce
Steps to reproduce the behavior:
docfx --serve --open-browserExpected behavior
URLs with different port numbers from the current site should be marked as external and therefore not be active.
Context (please complete the following information):