diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index 83a4452f42..be396c6626 100644 --- a/config/jsdoc/api/template/static/scripts/main.js +++ b/config/jsdoc/api/template/static/scripts/main.js @@ -278,11 +278,11 @@ $(function () { // warn about outdated version const currentVersion = document.getElementById('package-version').innerHTML; - const packageUrl = 'https://raw.githubusercontent.com/openlayers/openlayers.github.io/build/package.json'; - fetch(packageUrl).then(function(response) { + const releaseUrl = 'https://api.github.com/repos/openlayers/openlayers/releases/latest'; + fetch(releaseUrl).then(function(response) { return response.json(); }).then(function(json) { - const latestVersion = json.version; + const latestVersion = json.name.replace(/^v/, ''); document.getElementById('latest-version').innerHTML = latestVersion; const url = window.location.href; const branchSearch = url.match(/\/([^\/]*)\/apidoc\//); diff --git a/examples/templates/example.html b/examples/templates/example.html index 2d6a59a70b..e4b084ffa0 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -186,11 +186,11 @@ });