Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling External Links for MDX globally #223

Merged
merged 5 commits into from
Oct 7, 2021
Merged

Conversation

imadarai
Copy link

@imadarai imadarai commented Oct 6, 2021

This PR address external links opening in a new window and displaying an Icon next to it. This is addressed globally for all MDX files, so we don't need to go in and change each MDX file individually.

The current ExternalLink components can be left as is or replaced with Markdown syntax.

If there are any strong opinions about #3 , I can introduce changes in this PR.

As it stands right now:

  • Any link that starts with https will open in a new tab
  • Links that includes /rustdocs/ will open in new tab
    rest will remain locally (including hash tags).

As this is a global change, I need to scan some more documents to make sure its not introducing any bugs or edge cases.
Will merge this tomorrow if everyone is on board 😄

@netlify
Copy link

netlify bot commented Oct 6, 2021

✔️ Deploy Preview for substrate-docs-staging ready!

🔨 Explore the source changes: 0d9cf5c

🔍 Inspect the deploy log: https://app.netlify.com/sites/substrate-docs-staging/deploys/615ee8fa569b18000857625d

😎 Browse the preview: https://deploy-preview-223--substrate-docs-staging.netlify.app

@imadarai imadarai changed the title Ia/external links Handling External Links for MDX globally Oct 6, 2021
@imadarai imadarai merged commit 1b64fe4 into develop Oct 7, 2021
@imadarai imadarai deleted the ia/external-links branch October 7, 2021 12:52
@nuke-web3
Copy link
Contributor

nuke-web3 commented Oct 9, 2021

> The current ExternalLink components can be left as is or replaced with Markdown syntax.

does this imply all MD style []() links are treated as external? that is the behavior I see now on develop. Not the desired behavior for internal links.

Ah I see the issue is in the div, all links there are treated as "external" from what I see.

Update: seems it was a 👻 - all working as expected now on master (after #250 landed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants