This issue is a followup from some discussions and blogposts elsewhere.
squidfunk/mkdocs-material#4513 requested an icon marking external links in mkdocs-material. It was then proposed to fix this locally with CSS attribute matching to detect relative links, which worked fine and I also used in some documentation sites.
Until squidfunk/mkdocs-material#6582 (comment) explained how mkdocs-material would henceforth only use absolute URLs to fix navigation issues. All of a sudden the CSS trick produced "external link" arrows everywhere.
Following this I requested that real absolute links be marked rel="external" in the HTML so we can apply styling even cleaner, and benefit from its other semantics.
This is where @squidfunk redirected me upstream to create this issue 😄
Now that URL matching doesn't work unless I hardcode the live deployment hostname - can we just get a standards-compliant rel="external" on non-internal links?
Sure, that's a great idea. Could I maybe ask you to create an issue / feature request at MkDocs, since Material for MkDocs only consumes what MkDocs produces – the Markdown to HTML translation, which is the part where this functionality needs to be added is here, and is done entirely as part of MkDocs, not Material for MkDocs.
I'm not a core maintainer of MkDocs, but judging from my knowledge of the internals, I'd guess that this could be very easily added in the _RelativePathTreeprocessor, which detects and replaces all links with their target URLs. Adding a check for externals URLs here, where the node is already available, and then adding rel=external should be a few lines of code.
This issue is a followup from some discussions and blogposts elsewhere.
squidfunk/mkdocs-material#4513 requested an icon marking external links in
mkdocs-material. It was then proposed to fix this locally with CSS attribute matching to detect relative links, which worked fine and I also used in some documentation sites.Until squidfunk/mkdocs-material#6582 (comment) explained how
mkdocs-materialwould henceforth only use absolute URLs to fix navigation issues. All of a sudden the CSS trick produced "external link" arrows everywhere.Following this I requested that real absolute links be marked
rel="external"in the HTML so we can apply styling even cleaner, and benefit from its other semantics.This is where @squidfunk redirected me upstream to create this issue 😄