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

Add icon to external links #4

Open
timvink opened this issue Oct 24, 2023 · 2 comments
Open

Add icon to external links #4

timvink opened this issue Oct 24, 2023 · 2 comments

Comments

@timvink
Copy link

timvink commented Oct 24, 2023

It would be cool if you could add an option to enable adding an icon behind links to show that links open in a new tab.

Something like this:

# mkdocs.yaml
plugins:
  - search
  - open-in-new-tab:
      add_icon: true

Then it could look like this:

image

Mkdocs-material already has a nice set of icons you can choose from

image

Technically, you would have to add an extra event event that processes and updates either the markdown or the HTML. An example of a plugin that does this is table-reader

@JakubAndrysek
Copy link
Owner

JakubAndrysek commented Oct 25, 2023

I have tested adding icons using JS, but it will also add icons next to the images and to the top Github link.
So I will have to modify the generated HTML as you wrote in the previous comment.

More in new external-links-icon branch

image

@timvink
Copy link
Author

timvink commented Oct 26, 2023

Looks great though

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

When branches are created from issues, their pull requests are automatically linked.

2 participants