mirror of https://github.com/joshbuchea/HEAD.git
Add js back to open external links in new tab
This commit is contained in:
parent
4cd6e5ce9b
commit
425dcc2107
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue