From 505d94577513b11bdb3475db17e43c1f321d7cce Mon Sep 17 00:00:00 2001 From: Jake Laderman Date: Mon, 25 Nov 2024 14:43:22 -0500 Subject: [PATCH] change form in marketing components to be a code embed (#124) * fix forms to enable hubspot * change landing page routes * add redirect --- app/api/newsletter/route.ts | 3 +-- pages/{kubernetes => }/[keyword].tsx | 0 pages/kubernetes/[...slug].tsx | 17 ++++++++++++++++ src/components/custom-page/Multimedia.tsx | 24 ++++++++++++++++++++--- 4 files changed, 39 insertions(+), 5 deletions(-) rename pages/{kubernetes => }/[keyword].tsx (100%) create mode 100644 pages/kubernetes/[...slug].tsx diff --git a/app/api/newsletter/route.ts b/app/api/newsletter/route.ts index 33fb230c..7c0e4f81 100644 --- a/app/api/newsletter/route.ts +++ b/app/api/newsletter/route.ts @@ -47,8 +47,7 @@ async function setEmail(email) { } if (body?.category === 'CONFLICT') { - const contactId = body.message?.match(/Existing ID:\s*(?\d+)/) - ?.groups?.id + const contactId = body.message?.match(/Existing ID:\s*(\d+)/)?.[1] if (!contactId) { return false diff --git a/pages/kubernetes/[keyword].tsx b/pages/[keyword].tsx similarity index 100% rename from pages/kubernetes/[keyword].tsx rename to pages/[keyword].tsx diff --git a/pages/kubernetes/[...slug].tsx b/pages/kubernetes/[...slug].tsx new file mode 100644 index 00000000..271ac717 --- /dev/null +++ b/pages/kubernetes/[...slug].tsx @@ -0,0 +1,17 @@ +import { type GetServerSideProps } from 'next' + +export const getServerSideProps: GetServerSideProps = async ({ params }) => { + const slug = params?.slug as string[] + const newPath = `/${slug.join('/')}` + + return { + redirect: { + destination: newPath, + permanent: true, + }, + } +} + +export default function KubernetesRedirect() { + return null +} diff --git a/src/components/custom-page/Multimedia.tsx b/src/components/custom-page/Multimedia.tsx index 4fa9e254..f9df6d92 100644 --- a/src/components/custom-page/Multimedia.tsx +++ b/src/components/custom-page/Multimedia.tsx @@ -1,7 +1,5 @@ import { type ComponentPropsWithRef } from 'react' -import { Code } from '@pluralsh/design-system' - import styled from 'styled-components' import { getImageUrl } from '@src/consts/routes' @@ -47,7 +45,27 @@ export function Multimedia({ url={videoUrl ?? ''} /> ) : mediaType === 'form' ? ( - {form ?? ''} +