Fix banner for old versions of the docs
parent
eedbbc757c
commit
a10c8e24aa
|
@ -1,18 +1,5 @@
|
||||||
window.addEventListener("DOMContentLoaded", function() {
|
window.addEventListener("DOMContentLoaded", function() {
|
||||||
|
if(!window.location.pathname.endsWith("/latest/")){
|
||||||
var xhr = new XMLHttpRequest();
|
document.querySelector("div[data-md-component=announce]").innerHTML = "You are seeing the docs for a previous version of RAPIDS, <a href='latest/'>click here to go to the latest</a>"
|
||||||
xhr.open("GET", window.location + "../versions.json");
|
}
|
||||||
xhr.onload = function() {
|
|
||||||
var versions = JSON.parse(this.responseText);
|
|
||||||
|
|
||||||
var realVersion = versions.find(function(i) {
|
|
||||||
return i.version === CURRENT_VERSION ||
|
|
||||||
i.aliases.includes(CURRENT_VERSION);
|
|
||||||
}).version;
|
|
||||||
|
|
||||||
console.log(version)
|
|
||||||
console.log(CURRENT_VERSION)
|
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,3 +12,16 @@
|
||||||
color: var(--md-typeset-a-color);
|
color: var(--md-typeset-a-color);
|
||||||
background-color: var(--md-code-bg-color);
|
background-color: var(--md-code-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div[data-md-component=announce] {
|
||||||
|
background-color: rgba(255,145,0,.1);
|
||||||
|
padding: 15px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: .8rem;
|
||||||
|
color: var(--md-admonition-fg-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
div[data-md-component=announce]>a{
|
||||||
|
color: var(--md-typeset-a-color);
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
Loading…
Reference in New Issue