0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
wagtail/docs/_templates/layout.html
2024-02-08 07:37:01 +10:00

114 lines
9.8 KiB
HTML

{% extends "!layout.html" %}
{% set docsearch_version = '2' %}
{% set docsearch_base = 'https://cdn.jsdelivr.net/npm/docsearch.js@' ~ docsearch_version ~ '/dist/cdn/' %}
{% block extrahead %}
<meta name="docsearch:version" content="{% if READTHEDOCS and current_version %}{{ current_version }}{% else %}unknown{% endif %}" />
<link rel="stylesheet" href="{{ docsearch_base ~ 'docsearch.min.css' }}"/>
<link rel="stylesheet" href="{{ pathto('_static/css/docsearch.overrides.css', 1) }}" />
<link rel="stylesheet" href="{{ pathto('_static/css/pagination.css', 1) }}" />
<link rel="stylesheet" href="{{ pathto('_static/css/custom.css', 1) }}" />
{% endblock %}
{% block search %}
<script async defer data-domain="docs.wagtail.org" src="https://plausible.io/js/plausible.js"></script>
<script src="{{ docsearch_base }}docsearch.min.js"></script>
<script>
/**
* Get version of the currently served docs.
*
* PR builds have their version set to the PR ID (for example "6753").
* If the docs are built for a PR or local development, use the "latest" facet filter.
* Otherwise, use the facet filter for the current version.
*/
function getReadTheDocsVersion() {
const meta = document.querySelector('meta[name="docsearch:version"]');
const rtd_version = meta ? meta.content : 'latest';
const version = rtd_version.match(/^(\d+|unknown)$/) ? 'latest' : rtd_version;
return version;
}
function getVersionFacetFilter() {
return `version:${getReadTheDocsVersion()}`;
}
/**
* Return true (debug: on) for local builds or Read the Docs PR previews.
*
* The debug mode allows inspection of the dropdown.
*/
function getSearchDebugMode() {
let debug = false
if (window.READTHEDOCS_DATA === undefined) {
// When developing locally, the `window.READTHEDOCS_DATA` object does not exist.
debug = true
} else {
// When PR preview on Readthedocs, then the version can be converted into
// a number. This does not work for the production version identifiers
// like 'stable', 'latest', 'v2.12', etc. In that case `Number()` is `NaN`.
const versionNumber = Number(window.READTHEDOCS_DATA.version)
debug = !isNaN(versionNumber)
}
return debug
}
function docSearchReady() {
/**
* Configure Algolia DocSearch.
* See https://github.com/wagtail/wagtail/wiki/Documentation-search for index configuration.
*/
const search = docsearch({
appId: 'XSYGEO7KMJ',
apiKey: 'd50a485660ed9280079aada4e09454b2',
indexName: 'wagtail',
inputSelector: '#searchbox [name="q"]',
algoliaOptions: {
facetFilters: [getVersionFacetFilter()],
},
autocompleteOptions: {
// Do NOT automatically select the first suggestion in the dropdown.
// https://github.com/algolia/autocomplete/blob/45fa32d008620cf52bf4a90530be338543dfba7f/README.md#global-options
autoSelect: false
},
debug: getSearchDebugMode(),
})
// Change page styles when the dropdown is open, to lock scrolling.
search.autocomplete.on('autocomplete:updated', function (event) {
const isOpen = event.target.value.trim() !== '';
document.body.classList.toggle('body--autocomplete-open', isOpen);
});
search.autocomplete.on('autocomplete:closed', function (event) {
document.body.classList.toggle('body--autocomplete-open', false);
});
return search
}
docSearchReady();
</script>
{% endblock %}
{% block footer %}
{{ super() }}
<template data-promotion-banner data-clear-duration="90" data-date-until="2024-06-14">
<div class="promotion-banner">
<svg aria-hidden="true" viewBox="0 0 190 132" width="36" height="36"><defs><path id="a" d="M89.58 26.597C81.876 11.063 65.8.375 47.213.375S12.552 11.063 4.85 26.597C1.746 32.857 0 39.902 0 47.354c0 6.875 1.484 13.404 4.15 19.288 12.926 1.555 27.562 2.432 43.064 2.432 15.503 0 30.138-.877 43.064-2.432 2.667-5.884 4.152-12.413 4.152-19.288 0-7.452-1.747-14.497-4.85-20.757"/></defs><g fill="none" fill-rule="evenodd"><g><g><path fill="#DFDFDF" d="M49.467 127.165h4.465V86.51h-4.465"/><path fill="#DFDFDF" d="M55.836 127.153c0 2.677-2.18 4.847-4.87 4.847s-4.87-2.17-4.87-4.847c0-2.676 2.18-4.846 4.87-4.846s4.87 2.17 4.87 4.846M134.91 127.165h4.466V86.51h-4.465"/><path fill="#DFDFDF" d="M142.404 127.153c0 2.677-2.18 4.847-4.87 4.847s-4.87-2.17-4.87-4.847c0-2.676 2.18-4.846 4.87-4.846s4.87 2.17 4.87 4.846"/><path fill="#D23C2B" d="M94.975 86.13L0 70.85s2.768 30.56 94.975 30.56c92.208 0 94.976-30.56 94.976-30.56L94.976 86.13"/><path fill="#DE4D33" d="M189.95 69.77c0 12.38-42.52 22.415-94.975 22.415C42.523 92.185 0 82.15 0 69.77 0 57.394 42.523 47.36 94.975 47.36c52.454 0 94.974 10.035 94.974 22.413"/><path fill="#DE4D33" d="M189.95 69.77c0 12.38-42.52 22.415-94.975 22.415C42.523 92.185 0 82.15 0 69.77 0 57.394 42.523 47.36 94.975 47.36c52.454 0 94.974 10.035 94.974 22.413"/><g transform="translate(48.343)"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#9FD6E4" xlink:href="#a"/><g mask="url(#b)"><g transform="translate(-25.858 10.068)"><path fill="#8DBEC9" d="M66.328 58.76h.987c6.65-.016 13.134-.195 19.39-.518-.003-.033-1.522-14.294-11.057-29.093-2.158 2.536-5.382 4.146-8.983 4.146-6.5 0-11.77-5.243-11.77-11.712 0-3.97 1.986-7.476 5.022-9.593-6.19-4.746-13.78-8.84-23.1-11.615C33 3.422 29.67 7.045 26.96 11.115c-1.033 1.55-1.98 3.16-2.826 4.828l-.015.03c-.01.017-.017.033-.025.05l-.036.07-.006.01-.09.18c-3.104 6.26-4.852 13.306-4.852 20.76 0 .757.02 1.51.054 2.26.288 6.045 1.725 11.79 4.098 17.026 12.926 1.554 27.562 2.43 43.064 2.43" opacity=".293"/><path fill="#FFF" fill-rule="nonzero" d="M85.573 11.186v5.07s-10.397-3.38-17.124 2.755c-4.894 4.447-5.302 9.427-3.06 16.095 22.018 0 25.483 10.76 25.483 10.76l-2.242-12.36 6.932-7.38c0-8.714-8.256-14.494-9.99-14.94z" opacity=".821"/><ellipse cx="86.568" cy="23.492" fill="#000" fill-rule="nonzero" opacity=".821" rx="2.249" ry="2.237"/><path fill="#000" fill-rule="nonzero" d="M90.537 45.566s-3.35-14.862-25.274-10.833c-2.232-6.715-1.826-11.64 3.045-16.204 6.598-6.18 16.95-2.777 16.95-2.777V10.65c-3.653-1.432-7.104-1.7-10.96-1.7-14.11 0-21.925 9.31-25.274 15.577L9.338 88.897l11.165-1.88L0 121.932l14.31-2.238L25.274 92.21c31.06 0 70.846-9.85 65.264-46.644zM104.556 33.56l-8.79-7.83-6.95 7.83" opacity=".821"/><path fill="#FFF" fill-rule="nonzero" d="M30.355 83.898s1.006-.177 2.818-.53c1.812-.356 4.328-.887 7.347-1.596 1.51-.355 3.12-.798 4.83-1.33 1.712-.53 3.523-1.063 5.234-1.77 1.812-.622 3.624-1.42 5.435-2.305 1.81-.886 3.522-1.86 5.132-3.013.402-.266.805-.53 1.208-.886l1.207-.886c.705-.62 1.51-1.24 2.215-1.95.704-.62 1.308-1.328 1.912-2.037l.906-1.063.402-.532.403-.532c.2-.354.503-.708.704-1.063.2-.354.402-.71.704-1.063.1-.177.2-.355.302-.532.1-.177.2-.354.302-.53.2-.356.402-.71.503-1.065l.907-2.126c.2-.71.503-1.42.704-2.04.202-.62.303-1.328.504-1.86.1-.62.202-1.152.302-1.772.1-.532.2-1.063.2-1.506.102-.443.102-.886.203-1.33.1-1.594.1-2.48.1-2.48l1.61.088s-.1.975-.202 2.57c-.1.443-.1.886-.2 1.33-.102.53-.102 1.062-.303 1.594-.1.53-.302 1.152-.402 1.772-.202.62-.403 1.24-.604 1.95-.203.708-.504 1.328-.806 2.126-.302.71-.604 1.417-1.007 2.215-.2.354-.402.71-.604 1.063-.1.177-.2.355-.302.532l-.3.53c-.202.356-.504.71-.705 1.153-.302.355-.503.71-.805 1.064-.1.176-.302.353-.403.53l-.402.532-.906 1.063c-.706.71-1.31 1.418-2.115 2.038-.704.71-1.51 1.24-2.314 1.95l-1.207.885c-.403.266-.805.532-1.31.798-1.71 1.063-3.52 2.038-5.333 2.924-1.81.797-3.723 1.595-5.535 2.215-1.812.62-3.623 1.152-5.334 1.595-1.71.443-3.32.886-4.93 1.152-3.02.62-5.637 1.152-7.448 1.417-1.61.53-2.617.708-2.617.708z" opacity=".821"/></g></g></g><path fill="#9FD6E4" d="M75.325 68.613h.002-.002"/><path fill="#C7462F" d="M95.425 69.054h-.174.175c15.502 0 30.138-.877 43.064-2.432 2.372-5.235 3.81-10.982 4.097-17.027-.288 6.045-1.725 11.792-4.098 17.027-12.927 1.555-27.563 2.432-43.065 2.432m-.23 0h-.114.114m-.198 0h-.085.086m-.18 0h-.07.07m-.192 0h-.034.034m-.178 0h-.008.008"/><path fill="#1D2533" d="M137.33 26.445l-.09-.18.09.18m-.095-.19l-.036-.072c.01.023.024.047.035.072m-.06-.12l-.015-.03.016.03"/><path fill="#FFFFFE" d="M31.976 65.48c0 1.978-3.635 3.58-8.118 3.58-4.484 0-8.118-1.602-8.118-3.58 0-1.977 3.634-3.58 8.118-3.58 4.483 0 8.118 1.603 8.118 3.58M170.26 65.48c0 1.978-3.634 3.58-8.118 3.58s-8.118-1.602-8.118-3.58c0-1.977 3.634-3.58 8.118-3.58s8.118 1.603 8.118 3.58M58.957 76.666c0 1.977-3.634 3.58-8.117 3.58-4.483 0-8.118-1.603-8.118-3.58 0-1.976 3.635-3.58 8.118-3.58 4.483 0 8.117 1.604 8.117 3.58M145.525 76.666c0 1.977-3.634 3.58-8.117 3.58-4.484 0-8.118-1.603-8.118-3.58 0-1.976 3.634-3.58 8.118-3.58 4.483 0 8.117 1.604 8.117 3.58M103.93 80.022c0 1.977-3.636 3.58-8.12 3.58-4.483 0-8.118-1.603-8.118-3.58 0-1.976 3.635-3.58 8.12-3.58 4.482 0 8.117 1.604 8.117 3.58"/></g></g></g></svg>
<a href="https://nl.wagtail.space/">
<div>
<strong>Wagtail Space NL</strong>
<br>12 &ndash; 14 June 2024 in Arnhem, The Netherlands
</div>
</a>
<a href="https://us.wagtail.space/">
<div>
<strong>Wagtail Space US</strong>
<br>June 2024 in Philadelphia, USA
</div>
</a>
<button class="close" aria-label="Hide banner" aria-expanded="true" type="button" data-clear>&#x2715;</button>
</div>
</template>
{% endblock %}