Attention
+
+ You are reading the latest
+ (unstable) version of this documentation, which may document features not available
+ or compatible with Godot 3.x.
+
+ Checking the stable version of the documentation... +
+diff --git a/_static/js/custom.js b/_static/js/custom.js index 899bc76c0..03ae375db 100644 --- a/_static/js/custom.js +++ b/_static/js/custom.js @@ -1,9 +1,4 @@ -// Set this to `true` when the `latest` branch is significantly incompatible with the -// current `stable` branch, which can lead to confusion for users that land on -// `latest` instead of `stable`. -const inDev = true; - // Handle page scroll and adjust sidebar accordingly. // Each page has two scrolls: the main scroll, which is moving the content of the page; @@ -296,7 +291,9 @@ $(document).ready(() => { } } - if (inDev) { + // See `godot_is_latest` in conf.py + const isLatest = document.querySelector('meta[name=doc_is_latest]').content.toLowerCase() === 'true'; + if (isLatest) { // Add a compatibility notice using JavaScript so it doesn't end up in the // automatically generated `meta description` tag. @@ -306,24 +303,14 @@ $(document).ready(() => { 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.
-
- Checking the stable version - of the documentation... -
-Attention
+
+ You are reading the latest
+ (unstable) version of this documentation, which may document features not available
+ or compatible with Godot 3.x.
+
+ Checking the stable version of the documentation... +
+