-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: app router - /team, /org, /[user] booking pages (excl. embeds) #18186
Changes from 54 commits
ce0c847
5535bea
eb98496
3c3b568
c4fb7bc
704a667
2081334
d95d2d4
d3c53c1
d308a82
756fc52
dd7198d
424d550
284b99c
c67b23f
ddb0f9b
d3e32a6
068fbed
dfe0977
73d5d75
e35927d
d6eb699
8dec06b
d7acf67
8b6d226
095d985
85d1c77
ead55e0
29f2b13
bf641c2
6889882
77a0d66
f7dc059
06c3d8e
e821887
3a40e1b
8427859
11fdcd3
c46562c
fafd2da
883a0f5
c34926e
3199342
45aeb21
8082048
5cd0634
95cd728
34bc4b2
373a229
fc82764
df08b06
48a0066
d5f2276
3a3b4d0
ea08b53
26c29ce
876ea41
882d097
43d29cd
cbae15a
59b53d1
ee5c49e
baa6afc
be31292
ea3445f
cad082c
f6113e9
d685e8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { withAppDirSsr } from "app/WithAppDirSsr"; | ||
import type { PageProps } from "app/_types"; | ||
import { generateMeetingMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
import { headers, cookies } from "next/headers"; | ||
|
||
import { getOrgFullOrigin } from "@calcom/features/ee/organizations/lib/orgDomains"; | ||
import { UserRepository } from "@calcom/lib/server/repository/user"; | ||
|
||
import { buildLegacyCtx } from "@lib/buildLegacyCtx"; | ||
|
||
import { getServerSideProps } from "@server/lib/[user]/getServerSideProps"; | ||
|
||
import type { PageProps as LegacyPageProps } from "~/users/views/users-public-view"; | ||
import LegacyPage from "~/users/views/users-public-view"; | ||
|
||
export const generateMetadata = async ({ params, searchParams }: PageProps) => { | ||
const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams)); | ||
|
||
const { profile, markdownStrippedBio, isOrgSEOIndexable, entity } = props; | ||
const avatarUrl = await UserRepository.getAvatarUrl(profile.id); | ||
const meeting = { | ||
title: markdownStrippedBio, | ||
profile: { name: `${profile.name}`, image: avatarUrl }, | ||
users: [ | ||
{ | ||
username: `${profile.username ?? ""}`, | ||
name: `${profile.name ?? ""}`, | ||
}, | ||
], | ||
}; | ||
|
||
const metadata = await generateMeetingMetadata( | ||
meeting, | ||
() => profile.name, | ||
() => markdownStrippedBio, | ||
false, | ||
getOrgFullOrigin(entity.orgSlug ?? null) | ||
); | ||
|
||
const isOrg = !!profile?.organization; | ||
const allowSEOIndexing = | ||
(!isOrg && profile.allowSEOIndexing) || (isOrg && isOrgSEOIndexable && profile.allowSEOIndexing); | ||
|
||
return { | ||
...metadata, | ||
robots: { | ||
index: allowSEOIndexing, | ||
follow: allowSEOIndexing, | ||
}, | ||
}; | ||
}; | ||
|
||
const getData = withAppDirSsr<LegacyPageProps>(getServerSideProps); | ||
export default WithLayout({ getData, Page: LegacyPage })<"P">; |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,10 @@ export const generateMetadata = () => prepareRootMetadata(); | |
const getInitialProps = async (url: string) => { | ||
const { pathname, searchParams } = new URL(url); | ||
|
||
const isEmbed = pathname.endsWith("/embed") || (searchParams?.get("embedType") ?? null) !== null; | ||
const isEmbedSnippetGeneratorPath = pathname.startsWith("/event-types"); | ||
const isEmbed = | ||
(pathname.endsWith("/embed") || (searchParams?.get("embedType") ?? null) !== null) && | ||
!isEmbedSnippetGeneratorPath; | ||
const embedColorScheme = searchParams?.get("ui.color-scheme"); | ||
Comment on lines
+29
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I synced this file with |
||
|
||
const req = { headers: headers(), cookies: cookies() }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key difference is
const image = SEO_IMG_OGIMG + constructMeetingImage(meeting);
. Using constructMeetingImage is important to generate correct OG images.