We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ab2b349 + 1150dc5 commit c425f47Copy full SHA for c425f47
1 file changed
linea-theme/main.html
@@ -41,5 +41,27 @@
41
}
42
43
</script>
44
+
45
+ <!-- Force external links to open in a new tab -->
46
+ <script>
47
+ document.addEventListener("DOMContentLoaded", function () {
48
+ // Select all links inside the documentation
49
+ document.querySelectorAll("a[href]").forEach(function (link) {
50
+ // Skip internal anchors and same-origin links
51
+ const href = link.getAttribute("href");
52
+ if (
53
+ href.startsWith("#") ||
54
+ href.startsWith("/") ||
55
+ href.startsWith(".") ||
56
+ link.hostname === window.location.hostname
57
+ ) {
58
+ return;
59
+ }
60
+ // Set to open in new tab
61
+ link.setAttribute("target", "_blank");
62
+ link.setAttribute("rel", "noopener noreferrer");
63
+ });
64
65
+ </script>
66
{% endblock %}
67
0 commit comments