Skip to content

Commit 93e24a2

Browse files
authored
chore: load more async / defer (#2344)
1 parent 95097ea commit 93e24a2

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

docusaurus.config.ts

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ const config: Config = {
7474
className: "copyright-2023-ory-corp",
7575
line: "Copyright © 2023 Ory Corp",
7676
},
77+
{
78+
className: "copyright-2024-ory-corp",
79+
line: "Copyright © 2024 Ory Corp",
80+
},
81+
{
82+
className: "copyright-2025-ory-corp",
83+
line: "Copyright © 2025 Ory Corp",
84+
},
85+
{
86+
className: "copyright-2026-ory-corp",
87+
line: "Copyright © 2026 Ory Corp",
88+
},
7789
{
7890
className: "spdx-license-identifier",
7991
line: "SPDX-License-Identifier: Apache-2.0",
@@ -219,6 +231,16 @@ const config: Config = {
219231
],
220232
headTags: [
221233
// add css to the head
234+
...["InterVariable.woff2?v=4.0"].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+
})),
222244
{
223245
tagName: "link",
224246
attributes: {
@@ -227,18 +249,17 @@ const config: Config = {
227249
href: "/docs/fonts/fonts.css",
228250
},
229251
},
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-
),
252+
],
253+
scripts: [
254+
// Needed as a workaround for https://answers.netlify.com/t/trailing-slash-missing-on-proxied-netlify-site/36367
255+
{
256+
src: "https://consent.ory.com/cmp/init.js",
257+
defer: true,
258+
},
259+
{
260+
src: "https://consent.ory.com/index.js",
261+
defer: true,
262+
},
242263
],
243264
}
244265

src/theme/Root.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ 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>
1614
<KapaWidget />
1715
</>
1816
)

0 commit comments

Comments
 (0)