Compare commits

..

2 commits

5 changed files with 23 additions and 157 deletions

View file

@ -1,81 +0,0 @@
---
// Own cookie banner (no iubenda). Not a cookie wall: a floating card, the site
// stays usable behind it. Reject and Accept have the same weight. The only
// thing that needs consent is Google Analytics, loaded by window.loadAnalytics
// (BaseLayout) only after "Accept".
---
<section
id="cookie-banner"
aria-label="Cookie consent"
class="hidden fixed bottom-4 left-4 right-4 sm:right-auto sm:max-w-sm bg-white dark:bg-gray-800 shadow-2xl rounded-xl p-5 border border-gray-200 dark:border-gray-700 z-50"
style="animation: slideUp 0.3s ease-out;"
>
<p class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-2">Cookies, in short</p>
<p class="text-xs leading-relaxed text-gray-700 dark:text-gray-300 mb-4">
The site works without cookies. If you accept, Google Analytics tells me which pages people
read. If you reject, nothing changes for you.
<a href="/cookie-policy" class="underline hover:text-gray-900 dark:hover:text-white"
>Cookie Policy</a
>
</p>
<div class="flex gap-2">
<button
id="cookie-reject"
class="flex-1 px-3 py-2 bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 text-xs font-medium rounded-lg hover:opacity-90 transition-opacity"
>
Reject
</button>
<button
id="cookie-accept"
class="flex-1 px-3 py-2 bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900 text-xs font-medium rounded-lg hover:opacity-90 transition-opacity"
>
Accept
</button>
</div>
</section>
<script is:inline>
(function () {
var banner = document.getElementById("cookie-banner");
if (!banner) return;
var choose = function (value) {
try {
localStorage.setItem("cookieConsent", value);
localStorage.setItem("cookieConsentDate", String(Date.now()));
} catch (e) {}
banner.classList.add("hidden");
if (value === "accepted") {
window.loadAnalytics && window.loadAnalytics();
} else {
// Consent withdrawn: drop the Google Analytics cookies already set
document.cookie.split(";").forEach(function (raw) {
var name = raw.split("=")[0].trim();
if (name.indexOf("_ga") !== 0) return;
var host = location.hostname.replace(/^www\./, "");
["", "; domain=" + host, "; domain=." + host].forEach(function (domain) {
document.cookie = name + "=; Max-Age=0; path=/" + domain;
});
});
}
window.dispatchEvent(new Event("cookie-consent"));
};
document.getElementById("cookie-accept").addEventListener("click", function () {
choose("accepted");
});
document.getElementById("cookie-reject").addEventListener("click", function () {
choose("rejected");
});
// Footer "Cookie settings" reopens the banner
window.openCookieSettings = function () {
banner.classList.remove("hidden");
};
if (!window.getCookieConsent || !window.getCookieConsent()) {
banner.classList.remove("hidden");
}
})();
</script>

View file

@ -38,14 +38,6 @@ const maxWidth = width === "7xl" ? "max-w-7xl" : "max-w-4xl";
<a href="/cookie-policy" class="transition-colors duration-200 hover:text-gray-600 dark:hover:text-gray-300" title="Cookie Policy" <a href="/cookie-policy" class="transition-colors duration-200 hover:text-gray-600 dark:hover:text-gray-300" title="Cookie Policy"
>Cookie Policy</a >Cookie Policy</a
> >
<span class="text-gray-800 dark:text-gray-400">•</span>
<button
type="button"
onclick="window.openCookieSettings && window.openCookieSettings()"
class="transition-colors duration-200 hover:text-gray-600 dark:hover:text-gray-300"
>
Cookie settings
</button>
</div> </div>
</div> </div>
<div class="text-center sm:text-right text-gray-800 dark:text-gray-200 text-xs"> <div class="text-center sm:text-right text-gray-800 dark:text-gray-200 text-xs">

View file

@ -32,42 +32,20 @@ const fullImageUrl = image
: `${siteUrl}${image}` : `${siteUrl}${image}`
: `${siteUrl}${defaultImage}`; : `${siteUrl}${defaultImage}`;
const fullCanonicalUrl = canonicalUrl || `${siteUrl}${Astro.url.pathname}`; const fullCanonicalUrl = canonicalUrl || `${siteUrl}${Astro.url.pathname}`;
import CookieBanner from "../components/CookieBanner.astro";
--- ---
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<script is:inline> <script
// Google Analytics only after consent (CookieBanner). The choice lasts is:inline
// 6 months, then the banner asks again. defer
window.getCookieConsent = function () { src="https://stats.lorenzoiovino.com/s.js"
try { data-website-id="a9169043-dae9-4762-94e3-0c8286e2c6cc"
var value = localStorage.getItem("cookieConsent"); data-domains="lorenzoiovino.com,www.lorenzoiovino.com"
var date = Number(localStorage.getItem("cookieConsentDate") || 0); data-do-not-track="true"
if (!value || Date.now() - date > 180 * 24 * 60 * 60 * 1000) return null; ></script>
return value;
} catch (e) {
return null;
}
};
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
window.loadAnalytics = function () {
if (window.__gaLoaded) return;
window.__gaLoaded = true;
var script = document.createElement("script");
script.async = true;
script.src = "https://www.googletagmanager.com/gtag/js?id=G-SPLW5RY3HD";
document.head.appendChild(script);
gtag("js", new Date());
gtag("config", "G-SPLW5RY3HD");
};
if (window.getCookieConsent() === "accepted") window.loadAnalytics();
</script>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ -207,8 +185,6 @@ import CookieBanner from "../components/CookieBanner.astro";
<body class="bg-white dark:bg-gray-900 min-h-screen transition-colors duration-200"> <body class="bg-white dark:bg-gray-900 min-h-screen transition-colors duration-200">
<slot /> <slot />
<CookieBanner />
<!-- Dark Mode Suggestion Toast --> <!-- Dark Mode Suggestion Toast -->
<div <div
id="dark-mode-toast" id="dark-mode-toast"
@ -293,18 +269,7 @@ import CookieBanner from "../components/CookieBanner.astro";
const hasBeenDismissed = localStorage.getItem(TOAST_DISMISSED_KEY); const hasBeenDismissed = localStorage.getItem(TOAST_DISMISSED_KEY);
// Only show toast if user is in light mode and hasn't dismissed it // Only show toast if user is in light mode and hasn't dismissed it
// Never on top of the cookie banner: if it's open, wait for the answer
const bannerOpen = () => {
const banner = document.getElementById("cookie-banner");
return !!banner && !banner.classList.contains("hidden");
};
const showToast = () => { const showToast = () => {
if (bannerOpen()) {
window.addEventListener("cookie-consent", () => setTimeout(showToast, 1500), {
once: true,
});
return;
}
const isDarkMode = document.documentElement.classList.contains("dark"); const isDarkMode = document.documentElement.classList.contains("dark");
if (!isDarkMode && !hasBeenDismissed && toast) { if (!isDarkMode && !hasBeenDismissed && toast) {
toast.classList.remove("hidden"); toast.classList.remove("hidden");

View file

@ -1,13 +1,13 @@
--- ---
layout: ../layouts/LegalLayout.astro layout: ../layouts/LegalLayout.astro
title: "Cookie Policy" title: "Cookie Policy"
description: "Which cookies and local storage lorenzoiovino.com uses and how to change your choice." description: "Which cookies and local storage lorenzoiovino.com uses."
updated: "September 29, 2026" updated: "October 2, 2026"
--- ---
The site works without cookies. Analytics cookies are set only if you accept them. The site sets no cookies. That's why there is no cookie banner.
## Technical storage (always on) ## Technical storage
The site saves a few small values in your browser's local storage. They don't track you and are never sent to anyone. They only remember your choices: The site saves a few small values in your browser's local storage. They don't track you and are never sent to anyone. They only remember your choices:
@ -15,28 +15,20 @@ The site saves a few small values in your browser's local storage. They don't tr
|---|---|---| |---|---|---|
| `theme` | light or dark mode | until you clear it | | `theme` | light or dark mode | until you clear it |
| `darkModeToastDismissed` | don't show the "Try Dark Mode?" hint again | until you clear it | | `darkModeToastDismissed` | don't show the "Try Dark Mode?" hint again | until you clear it |
| `cookieConsent`, `cookieConsentDate` | your answer to the cookie banner | 6 months, then the banner asks again |
These are strictly necessary for the features you use, so they don't need consent. These are strictly necessary for the features you use, so they don't need consent.
## Analytics cookies (only if you accept) ## Visit statistics
If you click **Accept**, Google Analytics 4 sets these cookies to count visits: Visits are counted with **Umami**, self-hosted on my own server at OVH in France. It uses no cookies, doesn't store your IP address and shares nothing with third parties. More details are in the [Privacy Policy](/privacy-policy).
| Name | Provider | Duration |
|---|---|---|
| `_ga` | Google | 2 years |
| `_ga_<container id>` | Google | 2 years |
More details on how Google uses this data are in the [Privacy Policy](/privacy-policy) and in [Google's documentation](https://policies.google.com/technologies/cookies).
## Third-party content ## Third-party content
Some blog posts embed videos from YouTube and GIFs from Giphy. These services may set their own cookies when you open those posts. They are ruled by the cookie policies of [Google](https://policies.google.com/technologies/cookies) and [Giphy](https://support.giphy.com/hc/en-us/articles/360032872931-GIPHY-Privacy-Policy). Some blog posts embed videos from YouTube and GIFs from Giphy. These services may set their own cookies when you open those posts. They are ruled by the cookie policies of [Google](https://policies.google.com/technologies/cookies) and [Giphy](https://support.giphy.com/hc/en-us/articles/360032872931-GIPHY-Privacy-Policy).
## Change your choice ## Your choice
Use **Cookie settings** in the footer to open the banner again. If you switch from Accept to Reject, the Google Analytics cookies are deleted. You can also delete cookies and local storage from your browser settings at any time. You can delete cookies and local storage from your browser settings at any time.
## Contact ## Contact

View file

@ -2,7 +2,7 @@
layout: ../layouts/LegalLayout.astro layout: ../layouts/LegalLayout.astro
title: "Privacy Policy" title: "Privacy Policy"
description: "What personal data lorenzoiovino.com processes, why and what your rights are." description: "What personal data lorenzoiovino.com processes, why and what your rights are."
updated: "September 29, 2026" updated: "October 2, 2026"
--- ---
This is a personal website with a blog. It has no accounts, no forms and no newsletter, so it collects very little. This page explains what. This is a personal website with a blog. It has no accounts, no forms and no newsletter, so it collects very little. This page explains what.
@ -17,19 +17,17 @@ Contact: [thisloke@proton.me](mailto:thisloke@proton.me)
### Server logs ### Server logs
The site is hosted on a server of **OVH Srl** in Milan, Italy. Like any web server, it records technical data for every request: IP address, date and time, requested page, browser and operating system. These logs are used only to keep the site running and secure (errors, abuse, attacks) and are kept for a limited time. The site is hosted on a server of **OVH SAS** in Gravelines, France. Like any web server, it records technical data for every request: IP address, date and time, requested page, browser and operating system. These logs are used only to keep the site running and secure (errors, abuse, attacks) and are kept for a limited time.
Legal basis: legitimate interest in running a secure website (art. 6.1.f GDPR). Legal basis: legitimate interest in running a secure website (art. 6.1.f GDPR).
### Google Analytics (only if you accept) ### Visit statistics
If you click **Accept** on the cookie banner, the site loads **Google Analytics 4** (Google Ireland Limited / Google LLC) to count visits and see which pages people read. It uses cookies and collects usage data: pages visited, time on page, device, browser, approximate location. Google Analytics 4 does not store the full IP address. To count visits and see which pages people read, the site uses **Umami**, self-hosted on my own server at **OVH** in France. It sets no cookies and doesn't store your IP address. The data stays on my server and is not shared with third parties. If your browser sends a Do Not Track signal, the visit is not counted.
Data may be transferred to the United States. Google LLC is certified under the EU-US Data Privacy Framework. Since there are no cookies and no tracking, there is no cookie banner.
If you click **Reject**, Google Analytics is never loaded. You can change your choice at any time with **Cookie settings** in the footer. Legal basis: legitimate interest in knowing which pages are read (art. 6.1.f GDPR).
Legal basis: your consent (art. 6.1.a GDPR).
### Google Fonts ### Google Fonts
@ -47,7 +45,7 @@ If you write to me, I use your email address and what you write only to answer y
## Your rights ## Your rights
You can ask me to access, correct or delete your data, to restrict or object to its processing and to receive it in a portable format. You can withdraw your consent to analytics at any time, without affecting what happened before. You can ask me to access, correct or delete your data, to restrict or object to its processing and to receive it in a portable format.
Write to [thisloke@proton.me](mailto:thisloke@proton.me). If you think your data is processed unlawfully, you can also file a complaint with the Italian data protection authority, the [Garante per la protezione dei dati personali](https://www.garanteprivacy.it). Write to [thisloke@proton.me](mailto:thisloke@proton.me). If you think your data is processed unlawfully, you can also file a complaint with the Italian data protection authority, the [Garante per la protezione dei dati personali](https://www.garanteprivacy.it).