Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/overrides/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ <h1>Oops! We couldn't find this page</h1>
<a href="/">Go back</a>
</div>
</div>
{% endblock %}

{% block scripts %}
<!-- Add scripts that need to run before here -->
{{ super() }}
<!-- Add scripts that need to run afterwards here -->
<script>plausible("404",{ props: { path: document.location.pathname } });</script>
{% endblock %}
42 changes: 42 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{% extends "base.html" %}

{% block scripts %}
<!-- Add scripts that need to run before here -->
{{ super() }}
<!-- Add scripts that need to run afterwards here -->
<!-- Plausible analytics. Remove `.local` from the `scr` if you don't want local tracking -->
<script defer data-domain="ai.lefebvre-sarrut.eu" src="https://plausible.io/js/script.local.outbound-links.tagged-events.js"></script>
<!-- 404 error pages tracking -->
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<!-- Custom event goals -->
<script>
const toTag = [
{
attributeName: 'class',
attributeValue: 'glightbox',
classes: 'plausible-event-name=Click+Image plausible-event-zoom=In'
}
]

/* Register event handlers after documented loaded */
document.addEventListener('DOMContentLoaded', function (_e) {

/* Set up search tracking */
if (document.forms.search) {
const query = document.forms.search.query;
query.addEventListener("blur", function() {
if (this.value) plausible("Search", { props: { search_term: this.value } });
})
}

toTag.forEach(function (tagObject) {
const elements = document.querySelectorAll('[' + tagObject.attributeName + '="' + tagObject.attributeValue + '"]')
elements.forEach(function (element) {
tagObject.classes.split(' ').forEach(function (className) {
element.classList.add(className)
})
})
})
})
</script>
{% endblock %}
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ plugins:
external_assets_exclude:
- cdn.jsdelivr.net/npm/mathjax@3/*
- giscus.app/* # necessary for the functioning of giscus (404 error otherwise)
- plausible.io/* # necessary for the functioning of plausible (404 error on events otherwise)
# external_links: true # github action > Unrecognised configuration name: external_links
external_links_attr_map:
target: _blank
Expand All @@ -163,7 +164,6 @@ extra:
link: mailto:rd-feedback@lefebvre-sarrut.eu
name: Contact us


extra_css:
- stylesheets/extra.css

Expand Down