File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010// Read noindex flag from PUBLIC_ env (Astro will inline this at build time)
1111const robotsNoindex = import .meta .env .PUBLIC_ROBOTS_NOINDEX === " true" ;
12+ const isDev = import .meta .env .DEV ;
1213const canonicalUrl = new URL (url .pathname , site );
1314const metaDescription =
1415 description ??
@@ -29,7 +30,8 @@ const metaDescription =
2930 <slot name =" json-ld" />
3031 <slot name =" search-scripts" />
3132 <script src =" ../scripts/header.js" ></script >
32- <script >
33+ { ! isDev && (
34+ <script is :inline >
3335 if (navigator.serviceWorker) {
3436 navigator
3537 .serviceWorker
@@ -41,7 +43,7 @@ const metaDescription =
4143 console .log (' Service worker registration error:' , error );
4244 });
4345 }
44- </script >
46+ </script >) }
4547 <Font cssVariable =" --header" preload />
4648 <Font cssVariable =" --body" preload />
4749</head >
You can’t perform that action at this time.
0 commit comments