diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 943c25c..472ef96 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;