From db4103c5697afe41878ff68492c5efa1806d55fc Mon Sep 17 00:00:00 2001
From: Andres Villagra <89531860+KaiserOfNone@users.noreply.github.com>
Date: Wed, 22 May 2024 17:10:28 -0300
Subject: [PATCH] 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
---
app/features/tournament/routes/to.$id.tsx | 19 ++++++++++++++++++-
app/root.tsx | 5 ++++-
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/app/features/tournament/routes/to.$id.tsx b/app/features/tournament/routes/to.$id.tsx
index ba4940f2d..d12ca848a 100644
--- a/app/features/tournament/routes/to.$id.tsx
+++ b/app/features/tournament/routes/to.$id.tsx
@@ -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 = {
diff --git a/app/root.tsx b/app/root.tsx
index 24531074d..deefef45a 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -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({
/>
-