File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ const days = await getCollection("days");
2727 ))
2828 }
2929</Layout >
30- <script is:inline data-astro-rerun >
30+ <script >
31+ window.addEventListener('load', function() {
3132 function checkForAnchorAndHighlight() {
3233 const currentAnchor = window.location.hash.substring(1);
3334
@@ -37,7 +38,7 @@ const days = await getCollection("days");
3738 const targetH2 = allMatching[allMatching.length - 1];
3839
3940 if (targetH2) {
40- const parentElement = targetH2.parentElement;
41+ const parentElement: any = targetH2.parentElement;
4142
4243 if (parentElement) {
4344 const originalBorder = parentElement.style.border;
@@ -85,4 +86,6 @@ const days = await getCollection("days");
8586 checkForAnchorAndHighlight();
8687
8788 window.addEventListener('hashchange', checkForAnchorAndHighlight);
89+ document.addEventListener('astro:after-swap', checkForAnchorAndHighlight);
90+ });
8891</script >
You can’t perform that action at this time.
0 commit comments