Add js back to open external links in new tab

This commit is contained in:
Josh Buchea 2016-09-15 19:31:23 -07:00 committed by GitHub
parent 4cd6e5ce9b
commit 425dcc2107
1 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,21 @@
{{ content }}
</div>
</div>
<script>
// open external links in new tab
var links = document.links;
var linksLength = links.length;
var i;
for (i = 0; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].rel = 'noopener noreferrer';
links[i].target = '_blank';
}
}
</script>
</body>
{% include analytics.html %}
</html>