diff --git a/_static/js/custom.js b/_static/js/custom.js index b55c14f59..7e6d51d4d 100644 --- a/_static/js/custom.js +++ b/_static/js/custom.js @@ -253,22 +253,63 @@ $(document).ready(() => { if (inDev) { // Add a compatibility notice using JavaScript so it doesn't end up in the // automatically generated `meta description` tag. - const strippedUrl = [location.protocol, '//', location.host, location.pathname].join(''); - const updatedUrl = strippedUrl.replace('/latest/', '/stable/'); + + const baseUrl = [location.protocol, '//', location.host, location.pathname].join(''); + // These lines only work as expected in the production environment, can't test this locally. + const fallbackUrl = baseUrl.replace('/latest/', '/stable/'); + const homeUrl = baseUrl.split('/latest/')[0] + '/stable/'; + const searchUrl = homeUrl + 'search.html?q='; + + // Insert the base notice with a placeholder to display as we're making a request. document.querySelector('div[itemprop="articleBody"]').insertAdjacentHTML('afterbegin', ` -
Attention
You are reading the latest
(unstable) version of this documentation, which may document features not available
or compatible with Godot 3.x.
- See this page - for the stable version of this documentation. +
+ Checking the stable version + of the documentation...