Skip to content

Commit 18fa70e

Browse files
author
committed
Deployed 4a71562 with MkDocs version: 1.6.1
1 parent ce24398 commit 18fa70e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

assets/topbar.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
});
155155
}
156156

157+
157158
function ensureStyle() {
158159
/* Re-inject the hiding style if Material's instant navigation removed it. */
159160
if (!document.getElementById('utplsql-topbar-style')) {
@@ -292,6 +293,15 @@
292293
rewriteFeedbackLink();
293294
}
294295

296+
/* Re-set the mkdocs-material consent cookie at path=/ so it is shared across
297+
all versioned subdirectories. Without this the browser scopes it to the
298+
current version path (e.g. /v3.1.14/) and the banner reappears on every
299+
other version. Runs immediately so it beats Material's consent check. */
300+
var consentMatch = document.cookie.match(/(?:^|;\s*)__md_consent=([^;]*)/);
301+
if (consentMatch) {
302+
document.cookie = '__md_consent=' + consentMatch[1] + '; path=/; SameSite=Lax';
303+
}
304+
295305
/* Hide Material's built-in header controls immediately to prevent a flash
296306
where logo/palette appear before the topbar is painted. */
297307
ensureStyle();

0 commit comments

Comments
 (0)