mirror of https://github.com/joshbuchea/HEAD.git
fix #129 - only open external links in a new tab
This commit is contained in:
parent
1e4089a9e9
commit
209a58ee1a
|
@ -8,9 +8,6 @@
|
|||
<!-- <meta name="theme-color" content="#2980b9"> -->
|
||||
<!-- <meta name="google-site-verification" content=""> -->
|
||||
|
||||
<!-- Open all links in a new tab/window -->
|
||||
<base target="_blank">
|
||||
|
||||
<title>{% if page.title %}{{ page.title | xml_escape }}{% else %}{{ site.title | xml_escape }}{% endif %}</title>
|
||||
|
||||
<link rel="stylesheet" href="main.css">
|
||||
|
|
|
@ -32,6 +32,17 @@
|
|||
sel.addRange(range);
|
||||
};
|
||||
|
||||
// open external links in new tab
|
||||
var links = document.links;
|
||||
var linksLength = links.length;
|
||||
var i = 0;
|
||||
|
||||
for (i = 0; i < linksLength; i++) {
|
||||
if (links[i].hostname != window.location.hostname) {
|
||||
links[i].target = '_blank';
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
{% include analytics.html %}
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue