Skip to content

Scheduling infrastructure for absolutely everyone.

use https://github.com/calendso/og-image to show dynamic og-image of booking links with avatar and title of booking.

Malte Delfsa3b4cbeadd20
diff --git a/pages/[user].tsx b/pages/[user].tsx
index 62499c4f42b..fb1c3c95405 100644
--- a/pages/[user].tsx
+++ b/pages/[user].tsx
@@ -20,6 +20,8 @@ export default function User(props) {
<Head>
<title>{props.user.name || props.user.username} | Calendso</title>
<link rel="icon" href="/favicon.ico" />
+ <meta property="og:image" content={"https://og-image-inctrrupl-calend-so.vercel.app/" + encodeURIComponent("Book **" + (props.user.name || props.user.username) + "**") + ".png?md=1&images=https%3A%2F%2Fcalendso.com%2Fcalendso-logo-white.svg&images=" + encodeURIComponent(props.user.avatar)} />
+ <meta property="og:title" content={"Book " + (props.user.name || props.user.username) + " via Calendso"}/>
</Head>
<main className="max-w-2xl mx-auto my-24">
@@ -89,4 +91,4 @@ export function getRandomColorCode() {
color += Math.floor(Math.random() * 10);
}
return color;
-}
\ No newline at end of file
+}
diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsx
index 394358ebd56..b95646120f8 100644
--- a/pages/[user]/[type].tsx
+++ b/pages/[user]/[type].tsx
@@ -96,6 +96,9 @@ export default function Type(props) {
Calendso
</title>
<link rel="icon" href="/favicon.ico" />
+ <meta property="og:image" content={"https://og-image-inctrrupl-calend-so.vercel.app/" + encodeURIComponent("Book **" + (props.user.name || props.user.username) + "** <br>" + props.eventType.description) + ".png?md=1&images=https%3A%2F%2Fcalendso.com%2Fcalendso-logo-white.svg&images=" + encodeURIComponent(props.user.avatar)} />
+ <meta property="og:title" content={"Book " + (props.user.name || props.user.username) + " via Calendso"}/>
+ <meta property="og:description" content={props.eventType.description}/>
</Head>
<main
className={