diff --git a/astro.config.ts b/astro.config.ts index 438c0cc51..fcf2a3ae2 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -71,7 +71,7 @@ export default defineConfig({ remarkPlugins: [remarkMath, remarkGfm], rehypePlugins: [ rehypeSlug, - [rehypeMermaid, { strategy: "img-png" }], + [rehypeMermaid, { strategy: "pre-mermaid" }], [ rehypeAutolinkHeadings, { diff --git a/src/components/Footer/Subscribe/Subscribe.tsx b/src/components/Footer/Subscribe/Subscribe.tsx index b3ff1e221..1afdc0e41 100644 --- a/src/components/Footer/Subscribe/Subscribe.tsx +++ b/src/components/Footer/Subscribe/Subscribe.tsx @@ -3,7 +3,8 @@ import { useState, useEffect } from "preact/hooks" import MailchimpSubscribe from "react-mailchimp-subscribe" import SubscribeSvg from "~/assets/svgs/footer/subscribe.svg?react" import { clsx } from "~/lib" -import i18next, { changeLanguage, t } from "i18next" +import { t } from "i18next" +import { useI18nReady } from "~/hooks/useI18nReady" import EmailInput from "./EmailInput.tsx" import styles from "./Subscribe.module.css" @@ -19,8 +20,7 @@ export default function Subscribe(props) { const [email, setEmail] = useState("") const [customMessage, setCustomMessage] = useState("") const [emailValid, setEmailValid] = useState(false) - - i18next.changeLanguage(props.lang) + const isReady = useI18nReady(props.lang) useEffect(() => { setCustomMessage("") @@ -42,6 +42,10 @@ export default function Subscribe(props) { setEmail(e.target.value) } + if (!isReady) { + return null + } + return (
@@ -50,14 +54,20 @@ export default function Subscribe(props) {
-
{ t("landing.NewsletterCTA.title") }
-
- { t("landing.NewsletterCTA.text") } -
+
{t("landing.NewsletterCTA.title")}
+
{t("landing.NewsletterCTA.text")}
( + render={({ + subscribe, + status, + message, + }: { + subscribe: (data: { EMAIL: string }) => void + status: string + message: string + }) => (
handleSubmit(subscribe)} onEnter={() => handleSubmit(subscribe)} - placeholder= { t("landing.NewsletterCTA.placeholder") } + placeholder={t("landing.NewsletterCTA.placeholder")} end={status === "success"} /> {customMessage &&
{customMessage}
} diff --git a/src/components/HeadCommon.astro b/src/components/HeadCommon.astro index f024f2799..934e1914e 100644 --- a/src/components/HeadCommon.astro +++ b/src/components/HeadCommon.astro @@ -20,6 +20,12 @@ import "../styles/design-system/global-styles.css" + + +