feat: integrate Umami analytics with cv-view, theme-change, pdf-download and infra-visit tracking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
LIABEUF, Stephane (External) 2026-05-18 03:28:41 +02:00
parent 19c461de40
commit 5b8724819a

View file

@ -26,6 +26,8 @@
<meta name="twitter:creator" id="tw-creator" content="">
<!-- Schema.org JSON-LD injecté dynamiquement -->
<script type="application/ld+json" id="schema-jsonld"></script>
<!-- Analytics Umami -->
<script defer src="https://analytics.stephaneliabeuf.fr/script.js" data-website-id="e2570832-3cf4-4645-8d02-2e9676f123be"></script>
<!-- Print CSS -->
<style>
@media print {
@ -3178,7 +3180,7 @@
${esc(id.nom)}<span class="hero-name-line2">${esc(id.prenom)}</span>
</h1>
<p class="hero-subtitle">${esc(id.accroche)}</p>
<div style="margin-top:20px;display:inline-block"><a id="infraBtn" href="infrastructure.html" class="infra-btn">⚡ Voir mon infrastructure</a></div>
<div style="margin-top:20px;display:inline-block"><a id="infraBtn" href="infrastructure.html" class="infra-btn" data-umami-event="infra-visit">⚡ Voir mon infrastructure</a></div>
<div class="hero-stats">
${d.stats.map(s => `
<div class="stat-box">
@ -3330,6 +3332,7 @@
});
}, 200);
localStorage.setItem('cv-theme', theme);
if (typeof umami !== 'undefined') umami.track('theme-change', { theme });
}
// ══════════════════════════════════════════════
@ -3362,6 +3365,9 @@
// Lang dynamique depuis le JSON (défaut : fr)
document.documentElement.lang = data.identity.lang || 'fr';
// Tracking version CV
if (typeof umami !== 'undefined') umami.track('cv-view', { version: cvParam || 'master' });
// Restaurer le thème sauvegardé
const saved = localStorage.getItem('cv-theme');
if (saved && ['cyberpunk','bd','itpro','cgi'].includes(saved)) setTheme(saved);
@ -3444,6 +3450,7 @@
// TÉLÉCHARGEMENT PDF
// ══════════════════════════════════════════════
function downloadCV() {
if (typeof umami !== 'undefined') umami.track('pdf-download', { version: cvParam || 'master' });
window.print();
}
</script>