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

Open link in content in new window

Started by Muut Archive 10 years ago · 2 replies · 1864 views
10 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

10 years ago

There is an external_links plugin available.

10 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 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2951 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago