File tree 1 file changed +5
-2
lines changed 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");
27
27
))
28
28
}
29
29
</Layout >
30
- <script is:inline data-astro-rerun >
30
+ <script >
31
+ window.addEventListener('load', function() {
31
32
function checkForAnchorAndHighlight() {
32
33
const currentAnchor = window.location.hash.substring(1);
33
34
@@ -37,7 +38,7 @@ const days = await getCollection("days");
37
38
const targetH2 = allMatching[allMatching.length - 1];
38
39
39
40
if (targetH2) {
40
- const parentElement = targetH2.parentElement;
41
+ const parentElement: any = targetH2.parentElement;
41
42
42
43
if (parentElement) {
43
44
const originalBorder = parentElement.style.border;
@@ -85,4 +86,6 @@ const days = await getCollection("days");
85
86
checkForAnchorAndHighlight();
86
87
87
88
window.addEventListener('hashchange', checkForAnchorAndHighlight);
89
+ document.addEventListener('astro:after-swap', checkForAnchorAndHighlight);
90
+ });
88
91
</script >
You can’t perform that action at this time.
0 commit comments