diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 234c0b80..472ef96e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -34,8 +34,9 @@ {{ if eq "home" .Kind -}} /* Replace the download link if a Windows browser was detected */ try { - var href = $('.version > a')[0].href.match(/^(.*\/)tag(\/.*)$/); - var version = $('.version > a')[0].title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/); + var a = document.querySelector('.version > a') + var href = a?.href.match(/^(.*\/)tag(\/.*)$/); + var version = a?.title.match(/^Version ([0-9.]*)(\(([0-9]*)?\))?/); if (!href || !version || !navigator.userAgentData) throw 0; @@ -45,7 +46,7 @@ var architecture = browser.architecture == "arm" ? "arm64" : "64-bit"; var url = href[1] + 'download' + href[2] + '/Git-' + version[1] + '-' + architecture + '.exe'; - $('a.button:contains("Download")')[0].href = url; + document.getElementById("download").href = url; }) } catch(e) {} {{ end -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index f78680b7..c26b33f5 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -17,7 +17,7 @@