Added open graph tags for tournaments (#1736)

* Added some og tags to the tournament registration endpoint

* Removed the hardcoded image value

* Added explicit nulls to make the type system happy

* Moved the information to be available from to.id in general
This commit is contained in:
Andres Villagra 2024-05-22 17:10:28 -03:00 committed by GitHub
parent 05e9d53fe8
commit db4103c569
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 2 deletions

View File

@ -41,7 +41,24 @@ export const meta: MetaFunction = (args) => {
if (!data) return [];
return [{ title: makeTitle(data.tournament.ctx.name) }];
return [
{
property: "og:title",
content: makeTitle(data.tournament.ctx.name),
},
{
property: "og:description",
content: data.tournament.ctx.description,
},
{
property: "og:type",
content: "website",
},
{
property: "og:image",
content: HACKY_resolvePicture(data.tournament.ctx) + ".png",
},
];
};
export const handle: SendouRouteHandle = {

View File

@ -70,6 +70,10 @@ export const meta: MetaFunction = () => {
content:
"Competitive Splatoon Hub featuring gear planner, event calendar, builds by top players, and more!",
},
{
property: "og:image",
content: COMMON_PREVIEW_IMAGE,
},
];
};
@ -165,7 +169,6 @@ function Document({
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="theme-color" content="#010115" />
<meta property="og:image" content={COMMON_PREVIEW_IMAGE} />
<Meta />
<Links />
<ThemeHead />