mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Switch docs theme to Furo, refs #1746
This commit is contained in:
parent
1465fea479
commit
1d33fd03b3
10 changed files with 72 additions and 84 deletions
7
docs/_static/css/custom.css
vendored
7
docs/_static/css/custom.css
vendored
|
|
@ -1,7 +1,8 @@
|
|||
a.external {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
div .wy-side-nav-search > div.version {
|
||||
color: rgba(0,0,0,0.75);
|
||||
body[data-theme="dark"] .sidebar-logo-container {
|
||||
background-color: white;
|
||||
padding: 5px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
|
|
|||
27
docs/_static/js/custom.js
vendored
Normal file
27
docs/_static/js/custom.js
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
jQuery(function ($) {
|
||||
// Show banner linking to /stable/ if this is a /latest/ page
|
||||
if (!/\/latest\//.test(location.pathname)) {
|
||||
return;
|
||||
}
|
||||
var stableUrl = location.pathname.replace("/latest/", "/stable/");
|
||||
// Check it's not a 404
|
||||
fetch(stableUrl, { method: "HEAD" }).then((response) => {
|
||||
if (response.status == 200) {
|
||||
var warning = $(
|
||||
`<div class="admonition warning">
|
||||
<p class="first admonition-title">Note</p>
|
||||
<p class="last">
|
||||
This documentation covers the <strong>development version</strong> of Datasette.</p>
|
||||
<p>See <a href="${stableUrl}">this page</a> for the current stable release.
|
||||
</p>
|
||||
</div>`
|
||||
);
|
||||
warning.find("a").attr("href", stableUrl);
|
||||
var body = $("div.body");
|
||||
if (!body.length) {
|
||||
body = $("div.document");
|
||||
}
|
||||
body.prepend(warning);
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue