From 2e450138b27d717b386dd9b1ffc1baa37593ce27 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:11:57 +0100 Subject: [PATCH] chore: load more async / defer --- docusaurus.config.ts | 45 ++++++++++++++++++++++++++++++++------------ src/theme/Root.js | 2 -- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 0f87738f5b..cf103269f9 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -74,6 +74,18 @@ const config: Config = { className: "copyright-2023-ory-corp", line: "Copyright © 2023 Ory Corp", }, + { + className: "copyright-2024-ory-corp", + line: "Copyright © 2024 Ory Corp", + }, + { + className: "copyright-2025-ory-corp", + line: "Copyright © 2025 Ory Corp", + }, + { + className: "copyright-2026-ory-corp", + line: "Copyright © 2026 Ory Corp", + }, { className: "spdx-license-identifier", line: "SPDX-License-Identifier: Apache-2.0", @@ -219,6 +231,16 @@ const config: Config = { ], headTags: [ // add css to the head + ...["InterVariable.woff2?v=4.0"].map((font: string) => ({ + tagName: "link", + attributes: { + rel: "preload", + type: "font/woff2", + as: "font", + crossOrigin: "anonymous", + href: `/docs/fonts/${font.includes("Inter") ? "Inter" : "JetBrainsMono"}/${font}`, + }, + })), { tagName: "link", attributes: { @@ -227,18 +249,17 @@ const config: Config = { href: "/docs/fonts/fonts.css", }, }, - ...["InterVariable.woff2?v=4.0", "JetBrainsMono-Regular.woff2"].map( - (font: string) => ({ - tagName: "link", - attributes: { - rel: "preload", - type: "font/woff2", - as: "font", - crossOrigin: "anonymous", - href: `/docs/fonts/${font.includes("Inter") ? "Inter" : "JetBrainsMono"}/${font}`, - }, - }), - ), + ], + scripts: [ + // Needed as a workaround for https://answers.netlify.com/t/trailing-slash-missing-on-proxied-netlify-site/36367 + { + src: "https://consent.ory.com/cmp/init.js", + defer: true, + }, + { + src: "https://consent.ory.com/index.js", + defer: true, + }, ], } diff --git a/src/theme/Root.js b/src/theme/Root.js index 47adc5af4b..451a367a31 100644 --- a/src/theme/Root.js +++ b/src/theme/Root.js @@ -11,8 +11,6 @@ function Root({ children }) { return ( <> {children} - - )