menu
This commit is contained in:
parent
25cdb3bd0b
commit
31e1b729f3
28 changed files with 925 additions and 426 deletions
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<div class="name">
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Acore odorant</a></h3>
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Aulne glutineux</a></h3>
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Gouet d'Italie</a></h3>
|
||||
|
|
@ -171,7 +171,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Charme commun</a></h3>
|
||||
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Acore odorant</a></h3>
|
||||
|
|
@ -211,7 +211,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Aulne glutineux</a></h3>
|
||||
|
|
@ -232,7 +232,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Gouet d'Italie</a></h3>
|
||||
|
|
@ -253,7 +253,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Charme commun</a></h3>
|
||||
|
|
@ -279,7 +279,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Acore odorant</a></h3>
|
||||
|
|
@ -298,7 +298,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Aulne glutineux</a></h3>
|
||||
|
|
@ -319,7 +319,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Gouet d'Italie</a></h3>
|
||||
|
|
@ -340,7 +340,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Charme commun</a></h3>
|
||||
|
|
@ -361,7 +361,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Acorus_calamus_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Acore odorant</a></h3>
|
||||
|
|
@ -380,7 +380,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Alnus_glutinosa_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Aulne glutineux</a></h3>
|
||||
|
|
@ -401,7 +401,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
<img src="/img/Arum_italicum_morphology_outlook_illustration_photo.png">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Gléchome lierre terrestre</a></h3>
|
||||
|
|
@ -422,7 +422,7 @@
|
|||
|
||||
<article class="taxon">
|
||||
<figure>
|
||||
<img src="/images/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
<img src="/img/Ballota_nigra_morphology_outlook_illustration_photo.jpeg">
|
||||
</figure>
|
||||
<div class="name">
|
||||
<h3 class="vernacular"><a href="/species-single.html" target="_blank">Charme commun</a></h3>
|
||||
|
|
@ -458,35 +458,44 @@
|
|||
|
||||
<!-- SCRIPT À SUPPRIMER UNE FOIS LE SITE INTEGRÉ (include des composants)-->
|
||||
<script>
|
||||
function processIncludes() {
|
||||
const includes = document.querySelectorAll('include[src]');
|
||||
async function processIncludes(maxDepth = 5) {
|
||||
let depth = 0;
|
||||
|
||||
if (includes.length === 0) {
|
||||
return;
|
||||
}
|
||||
while (depth < maxDepth) {
|
||||
const includes = document.querySelectorAll('include[src]');
|
||||
if (includes.length === 0) break;
|
||||
|
||||
const promises = Array.from(includes).map(el => {
|
||||
const src = el.getAttribute('src');
|
||||
return fetch(src)
|
||||
.then(r => {
|
||||
if (!r.ok) throw new Error(`Erreur ${r.status}: ${src}`);
|
||||
return r.text();
|
||||
})
|
||||
.then(html => {
|
||||
el.outerHTML = html;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Erreur de chargement:', err);
|
||||
});
|
||||
});
|
||||
const promises = Array.from(includes).map(async el => {
|
||||
const src = el.getAttribute('src');
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
processIncludes();
|
||||
});
|
||||
}
|
||||
try {
|
||||
const response = await fetch(src, { cache: "no-store" });
|
||||
if (!response.ok) throw new Error(response.status);
|
||||
const html = await response.text();
|
||||
el.outerHTML = html;
|
||||
} catch (err) {
|
||||
console.error("Erreur include:", src, err);
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', processIncludes);
|
||||
await Promise.all(promises);
|
||||
|
||||
// Petite pause pour éviter rafale ultra rapide
|
||||
await new Promise(r => setTimeout(r, 50));
|
||||
|
||||
depth++;
|
||||
}
|
||||
|
||||
if (depth === maxDepth) {
|
||||
console.warn("Max include depth reached (possible boucle).");
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
processIncludes();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue