Skip to content
This repository was archived by the owner on May 18, 2023. It is now read-only.

Commit 00196dc

Browse files
committed
Add target="_blank" for all external links
1 parent b1445e4 commit 00196dc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

_layouts/default.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@
2828
ga('create', 'UA-61698331-1', 'auto');
2929
ga('send', 'pageview');
3030
</script>
31+
<script>
32+
var links = document.links;
33+
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
34+
if (links[i].hostname != window.location.hostname) {
35+
links[i].target = '_blank';
36+
}
37+
}
38+
</script>

0 commit comments

Comments
 (0)