Skip to content

Commit 6ff80f8

Browse files
committed
fix: fix utm js script
1 parent 5554a05 commit 6ff80f8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/_static/source-in-links.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ function addUTMSourceToLink(href) {
44
url.searchParams.set("utm_source", "docarray");
55
return url.href
66
}
7-
catch{}
7+
catch{
8+
return href
9+
}
810
}
911

10-
function addSourceToAllLinks() {
12+
function addUTMSourceToLinks() {
1113
var anchors = document.getElementsByTagName("a");
1214

1315
for (var i = 0; i < anchors.length; i++) {
14-
anchors[i].href = addUTMSourceToLinks(anchors[i].href)
16+
anchors[i].href = addUTMSourceToLink(anchors[i].href)
1517
}
1618
}
1719

1820
window.onload = function () {
19-
addSourceToAllLinks()
21+
addUTMSourceToLinks()
2022
}

0 commit comments

Comments
 (0)