sqlite-utils/docs/_templates/base.html

42 lines
1.3 KiB
HTML
Raw Permalink Normal View History

2022-05-20 14:51:30 -07:00
{%- extends "!base.html" %}
{% block site_meta %}
{{ super() }}
<script defer data-domain="sqlite-utils.datasette.io" src="https://plausible.io/js/plausible.js"></script>
2023-03-26 16:42:01 -07:00
{% endblock %}
{% block scripts %}
{{ super() }}
<style type="text/css">
.highlight-output .highlight {
border-left: 9px solid #30c94f;
}
</style>
2023-03-26 16:42:01 -07:00
<script>
document.addEventListener("DOMContentLoaded", 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 = document.createElement("div");
warning.className = "admonition warning";
warning.innerHTML = `
<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>
`;
var mainArticle = document.querySelector("article[role=main]");
mainArticle.insertBefore(warning, mainArticle.firstChild);
}
});
});
</script>
{% endblock %}