Skip to content

Commit 95097ea

Browse files
authored
fix: reduce preload stuff (#2343)
1 parent 032c91a commit 95097ea

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

docusaurus.config.ts

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -227,35 +227,18 @@ const config: Config = {
227227
href: "/docs/fonts/fonts.css",
228228
},
229229
},
230-
...[
231-
"InterVariable.woff2?v=4.0",
232-
"JetBrainsMono-Regular.woff2",
233-
"JetBrainsMono-Italic.woff2",
234-
].map((font: string) => ({
235-
tagName: "link",
236-
attributes: {
237-
rel: "preload",
238-
type: "font/woff2",
239-
as: "font",
240-
crossOrigin: "anonymous",
241-
href: `/docs/fonts/${font.includes("Inter") ? "Inter" : "JetBrainsMono"}/${font}`,
242-
},
243-
})),
244-
],
245-
scripts: [
246-
// Needed as a workaround for https://answers.netlify.com/t/trailing-slash-missing-on-proxied-netlify-site/36367
247-
{
248-
src: "/docs/scripts/redirect.js",
249-
async: true,
250-
},
251-
{
252-
src: "https://consent.ory.com/cmp/init.js",
253-
async: true,
254-
},
255-
{
256-
src: "https://consent.ory.com/index.js",
257-
async: true,
258-
},
230+
...["InterVariable.woff2?v=4.0", "JetBrainsMono-Regular.woff2"].map(
231+
(font: string) => ({
232+
tagName: "link",
233+
attributes: {
234+
rel: "preload",
235+
type: "font/woff2",
236+
as: "font",
237+
crossOrigin: "anonymous",
238+
href: `/docs/fonts/${font.includes("Inter") ? "Inter" : "JetBrainsMono"}/${font}`,
239+
},
240+
}),
241+
),
259242
],
260243
}
261244

src/theme/Root.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function Root({ children }) {
1111
return (
1212
<>
1313
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
14+
<script src={"//consent.ory.com/cmp/init.js"} async></script>
15+
<script src={"//consent.ory.com/index.js"} async></script>
1416
<KapaWidget />
1517
</>
1618
)

0 commit comments

Comments
 (0)