So I've been thinking about this since @paul121 opened up #21 and #22, particularly as I've shifted my thinking that links to the source repositories (not for editing docs, just for viewing source) probably fit best in the left navigation drawer. We could then add the "open-in-new" icon to those menu items, plus any other external links in the menu, like for the forum, chat and the Jitsi link. And while we're at it, it would be pretty easy to also set target="_blank" to open it in a new window as well. The easiest way to do this is probably to check if the href starts with 'http' or not. If we're doing that, we could also run other tests, like if it starts with 'https://github.com/' or 'http://twitter.com' and add a little GitHub or Twitter icon inline as well.
All this makes me think this logic should be written into the NestedNav component itself, or as a special ExternalLink component that could be used in NestedNav and elsewhere, since this seems more and more like a concern for the rendering layer.
Similarly, we could add some logic to gatsby-remark-prefix-relative-links to add a special class to external links, so we could append an ::after pseudo-element to those links with the same "open-in-new" icon, similar to how Wikipedia does with inline external links.
So I've been thinking about this since @paul121 opened up #21 and #22, particularly as I've shifted my thinking that links to the source repositories (not for editing docs, just for viewing source) probably fit best in the left navigation drawer. We could then add the "open-in-new" icon to those menu items, plus any other external links in the menu, like for the forum, chat and the Jitsi link. And while we're at it, it would be pretty easy to also set
target="_blank"to open it in a new window as well. The easiest way to do this is probably to check if the href starts with'http'or not. If we're doing that, we could also run other tests, like if it starts with'https://github.com/'or'http://twitter.com'and add a little GitHub or Twitter icon inline as well.All this makes me think this logic should be written into the
NestedNavcomponent itself, or as a specialExternalLinkcomponent that could be used inNestedNavand elsewhere, since this seems more and more like a concern for the rendering layer.Similarly, we could add some logic to
gatsby-remark-prefix-relative-linksto add a special class to external links, so we could append an::afterpseudo-element to those links with the same "open-in-new" icon, similar to how Wikipedia does with inline external links.