@@ -28,7 +28,7 @@ type Props = {
28
28
paddingBottom? : string
29
29
}
30
30
31
- const { title, description, paddingBottom = " ~pb-40/52" } = Astro .props
31
+ const { title, description, paddingBottom = ' ~pb-40/52' } = Astro .props
32
32
33
33
const app = {
34
34
' @context' : ' https://schema.org' ,
@@ -94,7 +94,7 @@ const app = {
94
94
95
95
<ClientRouter />
96
96
</head >
97
- <body class:list ={ [paddingBottom , ' ~pt-12/28' ]} >
97
+ <body class:list ={ [paddingBottom , ' ~pt-12/28' ]} >
98
98
<div class =" container inline-flex items-baseline justify-center whitespace-nowrap text-center" >
99
99
{
100
100
isActive (' /' , Astro .url ) ? (
@@ -141,6 +141,9 @@ const app = {
141
141
</style >
142
142
143
143
<script >
144
+ import type { Framework } from '@/lib/framework'
145
+ import { $pageFramework } from '@/stores/url'
146
+
144
147
// Disable smooth scroll when transitioning, which also fixes anchor links for some reason:
145
148
document.addEventListener('astro:before-swap', (event) => {
146
149
event.newDocument.documentElement.style.scrollBehavior = 'auto'
@@ -155,4 +158,13 @@ const app = {
155
158
{ once: true }
156
159
)
157
160
})
161
+
162
+ // Update framework on page load
163
+ document.addEventListener('astro:page-load', () => {
164
+ const framework = document.documentElement.dataset.framework as Framework
165
+ if (framework) {
166
+ localStorage.setItem('framework', framework)
167
+ $pageFramework.set(framework)
168
+ }
169
+ })
158
170
</script >
0 commit comments