Closed Floresiensis closed 2 months ago
Is possible [MyLink] (https://example.com) {target="_blank"}
without space between parts
More Options also available like extra Classes or Id in {} ex. [My Link](https://example.com){target="_blank" ref="" .extraclass .extraclass2 #myLinkId}
My Link{target="_blank" ref="" .extraclass .extraclass2 #myLinkId}
Is there a way to automate this? Links with http(s) should get the target attribute and relative links not.
I suppose it can only be automated with js, you can create a simple js plugin or add a js-file manually into your theme.This is what gtp says (not tested):
<script>
window.onload = function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (links[i].hostname !== window.location.hostname) {
links[i].target = '_blank';
}
}
};
</script>
Just my opinion: I nearly NEVER use target_blank since this is a very big limitation for your visitors. I know that website owners fear to loose readers when they link to other domains, but in 99% it is better to let the reader decide if he wants to visit that external page in a new window or in the same window. I personally quite pages that open new windows automatically and polute my browser tabs...
I want external links to open in a new browser tab. This way, readers of my site can view sources or partner websites without losing their location in my text and being directed away from my site, maybe for good.
Is there a way in Typemill to do this? I know that standard Markdown doesn't support new-tab links, and your documentation doesn't seem to mention them. HTML code (to handcraft links with the setting target="_blank") is disabled in Typemill Markdown. Am I missing something?
If this feature is actually missing from Typemill, I'm sure it would be of interest to many users and worth implementing.