diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx index 592df1c0ee..c125fc5277 100644 --- a/apps/web/components/booking/pages/AvailabilityPage.tsx +++ b/apps/web/components/booking/pages/AvailabilityPage.tsx @@ -371,7 +371,6 @@ const AvailabilityPage = ({ profile, eventType }: Props) => { const rainbowAppData = getEventTypeAppData(eventType, "rainbow") || {}; const rawSlug = profile.slug ? profile.slug.split("/") : []; if (rawSlug.length > 1) rawSlug.pop(); //team events have team name as slug, but user events have [user]/[type] as slug. - const slug = rawSlug.join("/"); // Define conditional gates here const gates = [ @@ -386,8 +385,16 @@ const AvailabilityPage = ({ profile, eventType }: Props) => { ({ + name: `${user.name}`, + username: `${user.username}`, + })), + ], + }} nextSeoProps={{ nofollow: eventType.hidden, noindex: eventType.hidden, diff --git a/apps/web/components/seo/head-seo.tsx b/apps/web/components/seo/head-seo.tsx index 6b9c538932..d0756ddb09 100644 --- a/apps/web/components/seo/head-seo.tsx +++ b/apps/web/components/seo/head-seo.tsx @@ -1,6 +1,13 @@ import merge from "lodash/merge"; import { NextSeo, NextSeoProps } from "next-seo"; -import React from "react"; + +import { + AppImageProps, + constructAppImage, + constructMeetingImage, + MeetingImageProps, +} from "@calcom/lib/OgImages"; +import { truncate, truncateOnWord } from "@calcom/lib/text"; import { getSeoImage, seoConfig } from "@lib/config/next-seo.config"; import { getBrowserInfo } from "@lib/core/browser/browser.utils"; @@ -9,11 +16,11 @@ export type HeadSeoProps = { title: string; description: string; siteName?: string; - name?: string; url?: string; - username?: string; canonical?: string; nextSeoProps?: NextSeoProps; + app?: AppImageProps; + meeting?: MeetingImageProps; }; /** @@ -63,32 +70,15 @@ const buildSeoMeta = (pageProps: { }; }; -const constructImage = (name: string, description: string, username: string): string => { - return ( - encodeURIComponent("Meet **" + name + "**
" + description).replace(/'/g, "%27") + - ".png?md=1&images=https%3A%2F%2Fcal.com%2Flogo-white.svg&images=" + - (process.env.NEXT_PUBLIC_WEBSITE_URL || process.env.NEXT_PUBLIC_WEBAPP_URL) + - "/" + - username + - "/avatar.png" - ); -}; - export const HeadSeo = (props: HeadSeoProps): JSX.Element => { const defaultUrl = getBrowserInfo()?.url; const image = getSeoImage("default"); - const { - title, - description, - name = null, - username = null, - siteName, - canonical = defaultUrl, - nextSeoProps = {}, - } = props; + const { title, description, siteName, canonical = defaultUrl, nextSeoProps = {}, app, meeting } = props; + + const truncatedDescription = truncate(description, 24); + const longerTruncatedDescriptionOnWords = truncateOnWord(description, 148); - const truncatedDescription = description.length > 24 ? description.substring(0, 23) + "..." : description; const pageTitle = title + " | Cal.com"; let seoObject = buildSeoMeta({ title: pageTitle, @@ -98,8 +88,20 @@ export const HeadSeo = (props: HeadSeoProps): JSX.Element => { siteName, }); - if (name && username) { - const pageImage = getSeoImage("ogImage") + constructImage(name, truncatedDescription, username); + if (meeting) { + const pageImage = getSeoImage("ogImage") + constructMeetingImage(meeting); + seoObject = buildSeoMeta({ + title: pageTitle, + description: truncatedDescription, + image: pageImage, + canonical, + siteName, + }); + } + + if (app) { + const pageImage = + getSeoImage("ogImage") + constructAppImage({ ...app, description: longerTruncatedDescriptionOnWords }); seoObject = buildSeoMeta({ title: pageTitle, description: truncatedDescription, diff --git a/apps/web/components/v2/apps/App.tsx b/apps/web/components/v2/apps/App.tsx index d86a47d05b..ef25c173c8 100644 --- a/apps/web/components/v2/apps/App.tsx +++ b/apps/web/components/v2/apps/App.tsx @@ -14,6 +14,8 @@ import { showToast, SkeletonText } from "@calcom/ui/v2"; import { Button, SkeletonButton, Shell } from "@calcom/ui/v2"; import DisconnectIntegration from "@calcom/ui/v2/modules/integrations/DisconnectIntegration"; +import HeadSeo from "@components/seo/head-seo"; + const Component = ({ name, type, @@ -276,6 +278,7 @@ const Component = ({ export default function App(props: { name: string; + description: AppType["description"]; type: AppType["type"]; isGlobal?: AppType["isGlobal"]; logo: string; @@ -300,7 +303,16 @@ export default function App(props: { const { t } = useLocale(); return ( - + + {props.licenseRequired ? ( diff --git a/apps/web/package.json b/apps/web/package.json index 83e9dba896..94ba52b067 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -60,6 +60,7 @@ "@stripe/stripe-js": "^1.35.0", "@tanstack/react-query": "^4.3.9", "@vercel/edge-functions-ui": "^0.2.1", + "@vercel/og": "^0.0.19", "@wojtekmaj/react-daterange-picker": "^3.3.1", "accept-language-parser": "^1.5.0", "async": "^3.2.4", diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx index daccef0ada..b44efaa16b 100644 --- a/apps/web/pages/[user].tsx +++ b/apps/web/pages/[user].tsx @@ -110,9 +110,13 @@ export default function User(props: inferSSRProps) { description={ isDynamicGroup ? `Book events with ${dynamicUsernames.join(", ")}` : (user.bio as string) || "" } - name={isDynamicGroup ? dynamicNames.join(", ") : nameOrUsername} - username={isDynamicGroup ? dynamicUsernames.join(", ") : (user.username as string) || ""} - // avatar={user.avatar || undefined} + meeting={{ + title: isDynamicGroup ? "" : `${user.bio}`, + profile: { name: `${profile.name}`, image: null }, + users: isDynamicGroup + ? dynamicUsernames.map((username, index) => ({ username, name: dynamicNames[index] })) + : [{ username: `${user.username}`, name: `${user.name}` }], + }} /> diff --git a/apps/web/pages/api/social/og/image.tsx b/apps/web/pages/api/social/og/image.tsx new file mode 100644 index 0000000000..49c3e7c0b4 --- /dev/null +++ b/apps/web/pages/api/social/og/image.tsx @@ -0,0 +1,90 @@ +import { ImageResponse } from "@vercel/og"; +import { NextApiRequest } from "next"; +import type { SatoriOptions } from "satori"; +import { z } from "zod"; + +import { Meeting, App } from "@calcom/lib/OgImages"; + +const calFont = fetch(new URL("../../../../public/fonts/cal.ttf", import.meta.url)).then((res) => + res.arrayBuffer() +); + +const interFont = fetch(new URL("../../../../public/fonts/Inter-Regular.ttf", import.meta.url)).then((res) => + res.arrayBuffer() +); + +const interFontMedium = fetch(new URL("../../../../public/fonts/Inter-Medium.ttf", import.meta.url)).then( + (res) => res.arrayBuffer() +); + +export const config = { + runtime: "experimental-edge", +}; + +const meetingSchema = z.object({ + imageType: z.literal("meeting"), + title: z.string(), + names: z.string().array(), + usernames: z.string().array(), + meetingProfileName: z.string(), + meetingImage: z.string().nullable().optional(), +}); + +const appSchema = z.object({ + imageType: z.literal("app"), + name: z.string(), + description: z.string(), + slug: z.string(), +}); + +export default async function handler(req: NextApiRequest) { + const { searchParams } = new URL(`${req.url}`); + const imageType = searchParams.get("type"); + + const [calFontData, interFontData, interFontMediumData] = await Promise.all([ + calFont, + interFont, + interFontMedium, + ]); + const ogConfig = { + fonts: [ + { name: "inter", data: interFontData, weight: 400 }, + { name: "inter", data: interFontMediumData, weight: 500 }, + { name: "cal", data: calFontData, weight: 400 }, + ] as SatoriOptions["fonts"], + }; + + switch (imageType) { + case "meeting": { + const { names, usernames, title, meetingProfileName, meetingImage } = meetingSchema.parse({ + names: searchParams.getAll("names"), + usernames: searchParams.getAll("usernames"), + title: searchParams.get("title"), + meetingProfileName: searchParams.get("meetingProfileName"), + meetingImage: searchParams.get("meetingImage"), + imageType, + }); + return new ImageResponse( + ( + ({ name, username: usernames[index] }))} + /> + ), + ogConfig + ); + } + case "app": { + const { name, description, slug } = appSchema.parse({ + name: searchParams.get("name"), + description: searchParams.get("description"), + slug: searchParams.get("slug"), + imageType, + }); + return new ImageResponse(, ogConfig); + } + default: + return new Response("What you're looking for is not here..", { status: 404 }); + } +} diff --git a/apps/web/pages/apps/[slug]/index.tsx b/apps/web/pages/apps/[slug]/index.tsx index 2b69e599a4..fd67db7395 100644 --- a/apps/web/pages/apps/[slug]/index.tsx +++ b/apps/web/pages/apps/[slug]/index.tsx @@ -34,6 +34,7 @@ function SingleAppPage({ data, source }: inferSSRProps) { return ( +
diff --git a/apps/web/public/cal-logo-word-black.svg b/apps/web/public/cal-logo-word-black.svg new file mode 100644 index 0000000000..7007d87c1c --- /dev/null +++ b/apps/web/public/cal-logo-word-black.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/apps/web/public/social-bg-dark.jpg b/apps/web/public/social-bg-dark.jpg new file mode 100644 index 0000000000..83f2481b41 Binary files /dev/null and b/apps/web/public/social-bg-dark.jpg differ diff --git a/apps/web/public/social-bg-light.jpg b/apps/web/public/social-bg-light.jpg new file mode 100644 index 0000000000..52624bf51b Binary files /dev/null and b/apps/web/public/social-bg-light.jpg differ diff --git a/packages/app-store/dailyvideo/static/icon.svg b/packages/app-store/dailyvideo/static/icon.svg index 4492598059..9658979017 100644 --- a/packages/app-store/dailyvideo/static/icon.svg +++ b/packages/app-store/dailyvideo/static/icon.svg @@ -1,4 +1,4 @@ - + diff --git a/packages/app-store/exchange2013calendar/static/icon.svg b/packages/app-store/exchange2013calendar/static/icon.svg index 82d06188fa..ea3189c3fd 100644 --- a/packages/app-store/exchange2013calendar/static/icon.svg +++ b/packages/app-store/exchange2013calendar/static/icon.svg @@ -1 +1,11 @@ -Exchange_64x \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/packages/app-store/exchange2016calendar/static/icon.svg b/packages/app-store/exchange2016calendar/static/icon.svg index 82d06188fa..ea3189c3fd 100644 --- a/packages/app-store/exchange2016calendar/static/icon.svg +++ b/packages/app-store/exchange2016calendar/static/icon.svg @@ -1 +1,11 @@ -Exchange_64x \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/packages/app-store/exchangecalendar/static/icon.svg b/packages/app-store/exchangecalendar/static/icon.svg index 82d06188fa..ea3189c3fd 100644 --- a/packages/app-store/exchangecalendar/static/icon.svg +++ b/packages/app-store/exchangecalendar/static/icon.svg @@ -1 +1,11 @@ -Exchange_64x \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/packages/app-store/googlecalendar/static/icon.svg b/packages/app-store/googlecalendar/static/icon.svg index 28f6a330bb..b749ecb7f1 100644 --- a/packages/app-store/googlecalendar/static/icon.svg +++ b/packages/app-store/googlecalendar/static/icon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/packages/app-store/office365calendar/static/icon.svg b/packages/app-store/office365calendar/static/icon.svg index 5592b3668a..2c6d3e6292 100644 --- a/packages/app-store/office365calendar/static/icon.svg +++ b/packages/app-store/office365calendar/static/icon.svg @@ -1,6 +1,6 @@ - + - + @@ -30,7 +30,7 @@ - + \ No newline at end of file diff --git a/packages/app-store/office365video/static/icon.svg b/packages/app-store/office365video/static/icon.svg index 3409e6cfae..9366046d0f 100644 --- a/packages/app-store/office365video/static/icon.svg +++ b/packages/app-store/office365video/static/icon.svg @@ -1,22 +1,21 @@ - - - + + - - - - - - - - - - + + + + + + + + + + - - - + + + \ No newline at end of file diff --git a/packages/app-store/riverside/static/icon.svg b/packages/app-store/riverside/static/icon.svg index 9a952fcbd2..0d13a14d6a 100644 --- a/packages/app-store/riverside/static/icon.svg +++ b/packages/app-store/riverside/static/icon.svg @@ -1,17 +1 @@ - - - - - - + \ No newline at end of file diff --git a/packages/app-store/stripepayment/static/icon.svg b/packages/app-store/stripepayment/static/icon.svg index cc7e34bc83..402e185f52 100644 --- a/packages/app-store/stripepayment/static/icon.svg +++ b/packages/app-store/stripepayment/static/icon.svg @@ -1,9 +1,4 @@ - - - - - - - + + + diff --git a/packages/lib/OgImages.tsx b/packages/lib/OgImages.tsx new file mode 100644 index 0000000000..168580d329 --- /dev/null +++ b/packages/lib/OgImages.tsx @@ -0,0 +1,172 @@ +import React from "react"; + +import { CAL_URL } from "./constants"; + +// Ensures tw prop is typed. +declare module "react" { + interface HTMLAttributes { + tw?: string; + } +} + +export interface MeetingImageProps { + title: string; + profile: { name: string; image?: string | null }; + users?: { name: string; username: string }[]; +} + +export interface AppImageProps { + name: string; + description: string; + slug: string; +} + +const joinMultipleNames = (names: string[] = []) => { + const lastName = names.pop(); + return `${names.length > 0 ? `${names.join(", ")} & ${lastName}` : lastName}`; +}; + +/** + * Test urls: + * 1. 1 user http://localhost:3000/api/social/og/image?type=meeting&title=super%20long%20event%20title%20for%20testing%20purposes&meetingProfileName=Pro%20Example&meetingImage=http://localhost:3000/pro/avatar.png&names=Pro%20Example&usernames=pro + * 2. Team event (collection), lot's of people, long title http://localhost:3000/api/social/og/image?type=meeting&title=Getting%20to%20know%20us%20and%20have%20a%20beer%20together&meetingProfileName=Seeded%20Team&names=Team%20Pro%20Example%202&names=Team%20Pro%20Example%203&names=Team%20Pro%20Example%204&names=Team%20Free%20Example&names=Team%20Pro%20Example&usernames=teampro2&usernames=teampro3&usernames=teampro4&usernames=teamfree&usernames=teampro + * 3. Team event of 2 (collection), http://localhost:3000/api/social/og/image?type=meeting&title=Getting%20to%20know%20each%20other&meetingProfileName=Seeded%20Team&names=Team%20Pro%20Example%202&names=Team%20Pro%20Example%203&usernames=teampro2&usernames=teampro3 + * 4. Team event (round robin) http://localhost:3000/api/social/og/image?type=meeting&title=Round%20Robin%20Seeded%20Team%20Event&meetingProfileName=Seeded%20Team + * 5. Dynamic collective (2 persons) http://localhost:3000/api/social/og/image?type=meeting&title=15min&meetingProfileName=Team%20Pro%20Example,%20Pro%20Example&names=Team%20Pro%20Example&names=Pro%20Example&usernames=teampro&usernames=pro + */ +export const constructMeetingImage = ({ title, users = [], profile }: MeetingImageProps): string => { + return [ + `?type=meeting`, + `&title=${encodeURIComponent(title)}`, + `&meetingProfileName=${encodeURIComponent(profile.name)}`, + profile.image && `&meetingImage=${encodeURIComponent(profile.image)}`, + `${users.map((user) => `&names=${encodeURIComponent(user.name)}`).join("")}`, + `${users.map((user) => `&usernames=${encodeURIComponent(user.username)}`).join("")}`, + // Joinining a multiline string for readability. + ].join(""); +}; + +/** + * Test url: + * http://localhost:3000/api/social/og/image?type=app&name=Huddle01&slug=/api/app-store/huddle01video/icon.svg&description=Huddle01%20is%20a%20new%20video%20conferencing%20software%20native%20to%20Web3%20and%20is%20comparable%20to%20a%20decentralized%20version%20of%20Zoom.%20It%20supports%20conversations%20for... + */ +export const constructAppImage = ({ name, slug, description }: AppImageProps): string => { + return [ + `?type=app`, + `&name=${encodeURIComponent(name)}`, + `&slug=${encodeURIComponent(slug)}`, + `&description=${encodeURIComponent(description)}`, + // Joinining a multiline string for readability. + ].join(""); +}; + +const Wrapper = ({ + children, + variant = "light", +}: { + children: React.ReactNode; + variant?: "light" | "dark"; +}) => ( +
+ background +
{children}
+
+); + +export const Meeting = ({ title, users = [], profile }: MeetingImageProps) => { + // We filter attendees here based on whether they have an image and filter duplicates. + // Users ALWAYS have an image (albeit a gray empty person avatar), so this mainly filters out + // any non existing images for dynamic collectives, while at the same time removing them from + // the names list, because the profile name of that event is a concatenation of all names. + const attendees = (profile?.image ? [profile, ...users] : users).filter( + (value, index, self) => self.findIndex((v) => v.name === value.name) == index + ); + + // Construct list of avatar urls, removes duplicates and empty profile images + const avatars = attendees + .map((user) => { + if ("image" in user && user?.image) return user.image; + if ("username" in user && user?.username) return `${CAL_URL}/${user.username}/avatar.png`; + return null; + }) + .filter(Boolean) as string[]; + + // In case there is NO other attendee than the single meeting profile without an image, we add + // that name back in here, since the event probably is a round robin event. + const names = attendees.length > 0 ? attendees.map((user) => user.name) : [profile.name]; + + return ( + +
+
+ Logo + {avatars.length > 0 &&
/
} +
+ {avatars.slice(0, 3).map((avatar) => ( + Profile picture + ))} + {avatars.length > 3 && ( +
+ +{avatars.length - 3} +
+ )} +
+
+
+
+ Meet{" "} + + {joinMultipleNames(names)} + +
+
+ {title} +
+ {/* Adds overlay gradient for long text */} +
+
+
+ + ); +}; + +export const App = ({ name, description, slug }: AppImageProps) => ( + + Logo +
+
+ App icon +
+
+
+
+ {name} +
+
{description}
+
+
+); diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index 12d817ed30..dee3306f43 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -34,5 +34,5 @@ export const POWERED_BY_URL = `${WEBSITE_URL}/?utm_source=embed&utm_medium=power export const DOCS_URL = "https://docs.cal.com"; export const DEVELOPER_DOCS = "https://developer.cal.com"; export const SEO_IMG_DEFAULT = `${WEBSITE_URL}/og-image.png`; -export const SEO_IMG_OGIMG = "https://og-image-one-pi.vercel.app/"; +export const SEO_IMG_OGIMG = `${CAL_URL}/api/social/og/image`; export const SEO_IMG_OGIMG_VIDEO = `${WEBSITE_URL}/video-og-image.png`; diff --git a/packages/lib/next-seo.config.ts b/packages/lib/next-seo.config.ts index 9a6c0a4890..bf0776987d 100644 --- a/packages/lib/next-seo.config.ts +++ b/packages/lib/next-seo.config.ts @@ -2,15 +2,17 @@ import { DefaultSeoProps, NextSeoProps } from "next-seo"; import { SEO_IMG_DEFAULT, SEO_IMG_OGIMG } from "@calcom/lib/constants"; +import { AppImageProps, MeetingImageProps } from "./OgImages"; + export type HeadSeoProps = { title: string; description: string; siteName?: string; - name?: string; url?: string; - username?: string; canonical?: string; nextSeoProps?: NextSeoProps; + app?: AppImageProps; + meeting?: MeetingImageProps; }; const seoImages = { diff --git a/packages/lib/package.json b/packages/lib/package.json index 0e2ca16370..5649b4679c 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -15,6 +15,7 @@ "@calcom/dayjs": "*", "@prisma/client": "^4.2.1", "@sendgrid/client": "^7.7.0", + "@vercel/og": "^0.0.19", "bcryptjs": "^2.4.3", "ical.js": "^1.4.0", "ics": "^2.37.0", diff --git a/packages/lib/text.ts b/packages/lib/text.ts new file mode 100644 index 0000000000..b1de80a8c8 --- /dev/null +++ b/packages/lib/text.ts @@ -0,0 +1,17 @@ +export const truncate = (text: string, maxLength: number, ellipsis = true) => { + if (text.length <= maxLength) return text; + return `${text.slice(0, maxLength - 3)}${ellipsis ? "..." : ""}`; +}; + +export const truncateOnWord = (text: string, maxLength: number, ellipsis = true) => { + if (text.length <= maxLength) return text; + + // First split on maxLength chars + let truncatedText = text.substring(0, 148); + // Then split on the last space, this way we split on the last word, + // which looks just a bit nicer. + truncatedText = truncatedText.substring(0, Math.min(truncatedText.length, truncatedText.lastIndexOf(" "))); + if (ellipsis) truncatedText += "..."; + + return truncatedText; +}; diff --git a/packages/ui/v2/core/Shell.tsx b/packages/ui/v2/core/Shell.tsx index c988cde284..c07fb6f460 100644 --- a/packages/ui/v2/core/Shell.tsx +++ b/packages/ui/v2/core/Shell.tsx @@ -126,14 +126,16 @@ const Layout = (props: LayoutProps) => { return ( <> - + {!props.withoutSeo && ( + + )}
@@ -173,6 +175,8 @@ type LayoutProps = { flexChildrenContainer?: boolean; isPublic?: boolean; withoutMain?: boolean; + // Gives you the option to skip HeadSEO and render your own. + withoutSeo?: boolean; }; const CustomBrandingContainer = () => { diff --git a/packages/ui/v2/core/head-seo.tsx b/packages/ui/v2/core/head-seo.tsx index f520c66e56..e4e179d0e1 100644 --- a/packages/ui/v2/core/head-seo.tsx +++ b/packages/ui/v2/core/head-seo.tsx @@ -1,9 +1,10 @@ import merge from "lodash/merge"; import { NextSeo, NextSeoProps } from "next-seo"; -import React from "react"; +import { constructAppImage, constructMeetingImage } from "@calcom/lib/OgImages"; import { getBrowserInfo } from "@calcom/lib/browser/browser.utils"; import { seoConfig, getSeoImage, HeadSeoProps } from "@calcom/lib/next-seo.config"; +import { truncate, truncateOnWord } from "@calcom/lib/text"; /** * Build full seo tags from title, desc, canonical and url @@ -52,32 +53,15 @@ const buildSeoMeta = (pageProps: { }; }; -const constructImage = (name: string, description: string, username: string): string => { - return ( - encodeURIComponent("Meet **" + name + "**
" + description).replace(/'/g, "%27") + - ".png?md=1&images=https%3A%2F%2Fcal.com%2Flogo-white.svg&images=" + - (process.env.NEXT_PUBLIC_WEBSITE_URL || process.env.NEXT_PUBLIC_WEBAPP_URL) + - "/" + - username + - "/avatar.png" - ); -}; - export const HeadSeo = (props: HeadSeoProps): JSX.Element => { const defaultUrl = getBrowserInfo()?.url; const image = getSeoImage("default"); - const { - title, - description, - name = null, - username = null, - siteName, - canonical = defaultUrl, - nextSeoProps = {}, - } = props; + const { title, description, siteName, canonical = defaultUrl, nextSeoProps = {}, app, meeting } = props; + + const truncatedDescription = truncate(description, 24); + const longerTruncatedDescriptionOnWords = truncateOnWord(description, 148); - const truncatedDescription = description.length > 24 ? description.substring(0, 23) + "..." : description; const pageTitle = title + " | Cal.com"; let seoObject = buildSeoMeta({ title: pageTitle, @@ -87,8 +71,20 @@ export const HeadSeo = (props: HeadSeoProps): JSX.Element => { siteName, }); - if (name && username) { - const pageImage = getSeoImage("ogImage") + constructImage(name, truncatedDescription, username); + if (meeting) { + const pageImage = getSeoImage("ogImage") + constructMeetingImage(meeting); + seoObject = buildSeoMeta({ + title: pageTitle, + description: truncatedDescription, + image: pageImage, + canonical, + siteName, + }); + } + + if (app) { + const pageImage = + getSeoImage("ogImage") + constructAppImage({ ...app, description: longerTruncatedDescriptionOnWords }); seoObject = buildSeoMeta({ title: pageTitle, description: truncatedDescription, diff --git a/yarn.lock b/yarn.lock index 44ce6848c7..62a99eea31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4549,24 +4549,6 @@ aria-hidden "^1.1.1" react-remove-scroll "^2.4.0" -"@radix-ui/react-slider@^0.1.1": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@radix-ui/react-slider/-/react-slider-0.1.4.tgz#a7b7a480ee00158195794b08cd3f1583cf102518" - integrity sha512-0z3bCcdrAi+FIcoLXS6r0ESVWuuyMnUJoCsFm7tC7Rtv95x34YtaI8YfSyQmzuMVS4rTsNtCCTZ/s727uRaVkQ== - dependencies: - "@babel/runtime" "^7.13.10" - "@radix-ui/number" "0.1.0" - "@radix-ui/primitive" "0.1.0" - "@radix-ui/react-collection" "0.1.4" - "@radix-ui/react-compose-refs" "0.1.0" - "@radix-ui/react-context" "0.1.1" - "@radix-ui/react-primitive" "0.1.4" - "@radix-ui/react-use-controllable-state" "0.1.0" - "@radix-ui/react-use-direction" "0.1.0" - "@radix-ui/react-use-layout-effect" "0.1.0" - "@radix-ui/react-use-previous" "0.1.1" - "@radix-ui/react-use-size" "0.1.1" - "@radix-ui/react-slider@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-slider/-/react-slider-1.0.0.tgz#4cabadd243aa088eb45ac710cd7cdc518fafb07e" @@ -4712,13 +4694,6 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-callback-ref" "1.0.0" -"@radix-ui/react-use-direction@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@radix-ui/react-use-direction/-/react-use-direction-0.1.0.tgz#97ac1d52e497c974389e7988f809238ed72e7df7" - integrity sha512-NajpY/An9TCPSfOVkgWIdXJV+VuWl67PxB6kOKYmtNAFHvObzIoh8o0n9sAuwSAyFCZVq211FEf9gvVDRhOyiA== - dependencies: - "@babel/runtime" "^7.13.10" - "@radix-ui/react-use-escape-keydown@0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-0.1.0.tgz#dc80cb3753e9d1bd992adbad9a149fb6ea941874" @@ -4771,13 +4746,6 @@ "@babel/runtime" "^7.13.10" "@radix-ui/rect" "1.0.0" -"@radix-ui/react-use-size@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-0.1.1.tgz#f6b75272a5d41c3089ca78c8a2e48e5f204ef90f" - integrity sha512-pTgWM5qKBu6C7kfKxrKPoBI2zZYZmp2cSXzpUiGM3qEBQlMLtYhaY2JXdXUCxz+XmD1YEjc8oRwvyfsD4AG4WA== - dependencies: - "@babel/runtime" "^7.13.10" - "@radix-ui/react-use-size@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.0.tgz#a0b455ac826749419f6354dc733e2ca465054771" @@ -4860,6 +4828,11 @@ tiny-warning "^1.0.3" tslib "^2.3.0" +"@resvg/resvg-wasm@2.0.0-alpha.4": + version "2.0.0-alpha.4" + resolved "https://registry.yarnpkg.com/@resvg/resvg-wasm/-/resvg-wasm-2.0.0-alpha.4.tgz#fc2f86186a9641df030d8f9f3f9d995899cd1ecb" + integrity sha512-pWIG9a/x1ky8gXKRhPH1OPKpHFoMN1ISLbJ+O+gPXQHIAKhNd5I28RlWf7q576hAOQA9JZTlo3p/M2uyLzJmmw== + "@rollup/pluginutils@^4.2.1": version "4.2.1" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d" @@ -5030,6 +5003,14 @@ dependencies: "@sentry/cli" "^1.73.0" +"@shuding/opentype.js@1.4.0-beta.0": + version "1.4.0-beta.0" + resolved "https://registry.yarnpkg.com/@shuding/opentype.js/-/opentype.js-1.4.0-beta.0.tgz#5d1e7e9e056f546aad41df1c5043f8f85d39e24b" + integrity sha512-3NgmNyH3l/Hv6EvsWJbsvpcpUba6R8IREQ83nH83cyakCw7uM1arZKNfHwv1Wz6jgqrF/j4x5ELvR6PnK9nTcA== + dependencies: + fflate "^0.7.3" + string.prototype.codepointat "^0.2.1" + "@sinclair/typebox@^0.24.1": version "0.24.19" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" @@ -6289,11 +6270,6 @@ lodash.isplainobject "^4.0.6" lodash.merge "^4.6.2" -"@tanstack/query-core@4.10.3": - version "4.10.3" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.10.3.tgz#a6477bab9ed1ae4561ca0a59ae06f8c615c692b7" - integrity sha512-+ME02sUmBfx3Pjd+0XtEthK8/4rVMD2jcxvnW9DSgFONpKtpjzfRzjY4ykzpDw1QEo2eoPvl7NS8J5mNI199aA== - "@tanstack/query-core@4.2.3": version "4.2.3" resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.2.3.tgz#52d75430c9662cc85c160761c1421de483c7791f" @@ -6323,14 +6299,6 @@ "@types/use-sync-external-store" "^0.0.3" use-sync-external-store "^1.2.0" -"@tanstack/react-query@^4.2.3": - version "4.10.3" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.10.3.tgz#294deefa0fb6ada88bc4631d346ef5d5551c5443" - integrity sha512-4OEJjkcsCTmG3ui7RjsVzsXerWQvInTe95CBKFyOV/GchMUlNztoFnnYmlMhX7hLUqJMhbG9l7M507V7+xU8Hw== - dependencies: - "@tanstack/query-core" "4.10.3" - use-sync-external-store "^1.2.0" - "@tanstack/react-query@^4.3.9": version "4.3.9" resolved "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.3.9.tgz#13332a1d4dd404baec24c2853883bcb3cc61ea92" @@ -7396,6 +7364,15 @@ clsx "^1.1.1" next-transpile-modules "^8.0.0" +"@vercel/og@^0.0.19": + version "0.0.19" + resolved "https://registry.yarnpkg.com/@vercel/og/-/og-0.0.19.tgz#f0a796244c90b14aca40ee26225f2e046ccfda08" + integrity sha512-1LrPUlCoe8T+aEI1fGdvJDhwewK1/wpYlQnF+E9ERgJMFCnmWH4FA+NYBkQaJqxUUeHoutIxNZTHQFT39+I+BQ== + dependencies: + "@resvg/resvg-wasm" "2.0.0-alpha.4" + satori "0.0.42" + yoga-wasm-web "0.1.2" + "@vitejs/plugin-react@^1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-1.3.2.tgz#2fcf0b6ce9bcdcd4cec5c760c199779d5657ece1" @@ -9683,6 +9660,11 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== +camelize@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" + integrity sha512-W2lPwkBkMZwFlPCXhIlYgxu+7gC/NUlCtdK652DAJ1JdgV0sTrvuPFshNPrFa1TY2JOkLhgdeEBplB4ezEa+xg== + caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001359: version "1.0.30001365" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001365.tgz#72c2c3863b1a545cfd3d9953535bd2ee17568158" @@ -10702,6 +10684,21 @@ crypto@^1.0.1: resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037" integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig== +css-background-parser@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/css-background-parser/-/css-background-parser-0.1.0.tgz#48a17f7fe6d4d4f1bca3177ddf16c5617950741b" + integrity sha512-2EZLisiZQ+7m4wwur/qiYJRniHX4K5Tc9w93MT3AS0WS1u5kaZ4FKXlOTBhOjc+CgEgPiGY+fX1yWD8UwpEqUA== + +css-box-shadow@1.0.0-3: + version "1.0.0-3" + resolved "https://registry.yarnpkg.com/css-box-shadow/-/css-box-shadow-1.0.0-3.tgz#9eaeb7140947bf5d649fc49a19e4bbaa5f602713" + integrity sha512-9jaqR6e7Ohds+aWwmhe6wILJ99xYQbfmK9QQB9CcMjDbTxPZjwEmUQpU91OG05Xgm8BahT5fW+svbsQGjS/zPg== + +css-color-keywords@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/css-color-keywords/-/css-color-keywords-1.0.0.tgz#fea2616dc676b2962686b3af8dbdbe180b244e05" + integrity sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg== + css-loader@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.6.0.tgz#2e4b2c7e6e2d27f8c8f28f61bffcd2e6c91ef645" @@ -10753,6 +10750,15 @@ css-select@^4.1.3: domutils "^2.8.0" nth-check "^2.0.1" +css-to-react-native@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-3.0.0.tgz#62dbe678072a824a689bcfee011fc96e02a7d756" + integrity sha512-Ro1yETZA813eoyUp2GDBhG2j+YggidUmzO1/v9eYBKR2EHVEniE2MI/NqpTQ954BMpTPZFsGNPm46qFB9dpaPQ== + dependencies: + camelize "^1.0.0" + css-color-keywords "^1.0.0" + postcss-value-parser "^4.0.2" + css-what@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" @@ -13064,6 +13070,11 @@ fetch@^1.0.1, fetch@^1.1.0: biskviit "1.0.1" encoding "0.1.12" +fflate@^0.7.3: + version "0.7.4" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.7.4.tgz#61587e5d958fdabb5a9368a302c25363f4f69f50" + integrity sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw== + fictional@^0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/fictional/-/fictional-0.4.13.tgz#3103cece766b62e8221d3a5c8dc5de043c9280ac" @@ -20006,7 +20017,7 @@ postcss-selector-parser@^6.0.0, postcss-selector-parser@^6.0.10, postcss-selecto cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss-value-parser@^4.0.0, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: +postcss-value-parser@^4.0.0, postcss-value-parser@^4.0.2, postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== @@ -21960,6 +21971,18 @@ sass-loader@^12.4.0: klona "^2.0.4" neo-async "^2.6.2" +satori@0.0.42: + version "0.0.42" + resolved "https://registry.yarnpkg.com/satori/-/satori-0.0.42.tgz#3cc4d7522e9264d1769a35f8da413811bb3b9752" + integrity sha512-ZZaNp2Ya1ACJ4Yf++e9Ccc1Rb6GcKjC9Nhcl4SQFcdM4VqCLfWHR6Iq7AdRCTcJDDuO8u/qGE2Cs+McVoqJenw== + dependencies: + "@shuding/opentype.js" "1.4.0-beta.0" + css-background-parser "^0.1.0" + css-box-shadow "1.0.0-3" + css-to-react-native "^3.0.0" + postcss-value-parser "^4.2.0" + yoga-layout-prebuilt "^1.10.0" + sax@>=0.6.0, sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -22843,6 +22866,11 @@ string-width@^5.0.0: emoji-regex "^9.2.2" strip-ansi "^7.0.1" +string.prototype.codepointat@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz#004ad44c8afc727527b108cd462b4d971cd469bc" + integrity sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg== + "string.prototype.matchall@^4.0.0 || ^3.0.1", string.prototype.matchall@^4.0.6, string.prototype.matchall@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" @@ -25906,13 +25934,18 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yoga-layout-prebuilt@^1.9.6: +yoga-layout-prebuilt@^1.10.0, yoga-layout-prebuilt@^1.9.6: version "1.10.0" resolved "https://registry.yarnpkg.com/yoga-layout-prebuilt/-/yoga-layout-prebuilt-1.10.0.tgz#2936fbaf4b3628ee0b3e3b1df44936d6c146faa6" integrity sha512-YnOmtSbv4MTf7RGJMK0FvZ+KD8OEe/J5BNnR0GHhD8J/XcG/Qvxgszm0Un6FTHWW4uHlTgP0IztiXQnGyIR45g== dependencies: "@types/yoga-layout" "1.9.2" +yoga-wasm-web@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/yoga-wasm-web/-/yoga-wasm-web-0.1.2.tgz#05d3fc9cbdfd57ac9682debb5001aca075489a39" + integrity sha512-8SkgawHcA0RUbMrnhxbaQkZDBi8rMed8pQHixkFF9w32zGhAwZ9/cOHWlpYfr6RCx42Yp3siV45/jPEkJxsk6w== + yup@^0.32.9: version "0.32.11" resolved "https://registry.yarnpkg.com/yup/-/yup-0.32.11.tgz#d67fb83eefa4698607982e63f7ca4c5ed3cf18c5"