From 78bcf9d3f64e0206c1bcac5504d51b3798b941d5 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 25 Aug 2022 12:50:23 +0200 Subject: [PATCH] Avoid rate limits from the GitHub API --- config/jsdoc/api/template/static/scripts/main.js | 4 ++-- examples/templates/example.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/jsdoc/api/template/static/scripts/main.js b/config/jsdoc/api/template/static/scripts/main.js index be396c6626..8a19393701 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 releaseUrl = 'https://api.github.com/repos/openlayers/openlayers/releases/latest'; + const releaseUrl = 'https://cdn.jsdelivr.net/npm/ol/package.json'; fetch(releaseUrl).then(function(response) { return response.json(); }).then(function(json) { - const latestVersion = json.name.replace(/^v/, ''); + const latestVersion = json.version; 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 cc620e312d..ff1b9c0e71 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -184,11 +184,11 @@ });