Add outdated warning to develop

pull/130/head
JulioV 2021-03-29 10:46:35 -04:00
parent 61d0300adc
commit 81be67d74d
3 changed files with 10 additions and 17 deletions

View File

@ -1,14 +0,0 @@
window.addEventListener("DOMContentLoaded", function() {
var xhr = new XMLHttpRequest();
xhr.open("GET", window.location.origin + "/versions.json");
xhr.onload = function() {
var versions = JSON.parse(this.responseText);
latest_version = ""
for(id in versions)
if(versions[id]["aliases"].length > 0 && versions[id]["aliases"].includes("latest"))
latest_version = "/" + versions[id].version + "/"
if(!window.location.pathname.includes("/latest/") && (latest_version.length > 0 && !window.location.pathname.includes(latest_version)))
document.querySelector("div[data-md-component=announce]").innerHTML = "<div id='announce-msg'>You are seeing the docs for a previous version of RAPIDS, <a href='http://www.rapids.science/'>click here to go to the latest</a></div>"
};
xhr.send();
});

View File

@ -4,3 +4,10 @@
<!-- Add custom comment system integration here -->
{% include "partials/integrations/utterances.html" %}
{% endblock %}
{% block outdated %}
You're not viewing the latest stable version of RAPIDS.
<a href="{{ config.site_url | url }}">
<strong> Click here to go to latest. </strong>
</a>
{% endblock %}

View File

@ -1,4 +1,5 @@
site_name: RAPIDS
site_url: https://www.rapids.science/
markdown_extensions:
- toc:
permalink: True
@ -35,14 +36,13 @@ markdown_extensions:
- def_list
extra:
version:
method: mike
provider: mike
social:
- icon: fontawesome/brands/twitter
link: 'https://twitter.com/julio_ui'
extra_javascript:
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
- javascripts/extra.js
repo_name: 'carissalow/rapids'
repo_url: 'https://github.com/carissalow/rapids'