Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Open link in content in new window

Started by Muut Archive 11 years ago · 2 replies · 1919 views
11 years ago

Hi there!

I am new to Grav and I love it!
I cannot however find a way to make links in content of pages open in new window (target="_blank"). Is there a working solution around? How do you set the link to open a new window in markdown?

Thanks in advance!
Best,
Ivan

11 years ago

There is an external_links plugin available.

11 years ago

Alternatively I solved with this piece of JavaScript:

JS

$(document.links).filter(function() {
    return this.hostname != window.location.hostname;
}).attr('target', '_blank');
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1721 9 years ago
Archive · by Muut Archive, 9 years ago
2 1156 9 years ago
Archive · by Muut Archive, 9 years ago
2 4321 9 years ago
Archive · by Muut Archive, 9 years ago
1 3211 9 years ago
Archive · by Muut Archive, 9 years ago
3 1311 9 years ago