We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8679fa7 commit f66c1caCopy full SHA for f66c1ca
1 file changed
src/layouts/Base.astro
@@ -374,5 +374,21 @@ const ogImage = lockdownImages.length > 0
374
</head>
375
<body>
376
<slot />
377
+ <script is:inline>
378
+ function openDetailsForHash() {
379
+ var hash = location.hash;
380
+ if (!hash) return;
381
+ var target = document.querySelector(hash);
382
+ if (!target) return;
383
+ var el = target;
384
+ while (el) {
385
+ if (el.tagName === 'DETAILS') el.open = true;
386
+ el = el.parentElement;
387
+ }
388
+ target.scrollIntoView();
389
390
+ openDetailsForHash();
391
+ window.addEventListener('hashchange', openDetailsForHash);
392
+ </script>
393
</body>
394
</html>
0 commit comments