feat: add opengraph tags
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
This commit is contained in:
parent
219d590e71
commit
650fa5fb4c
4 changed files with 12 additions and 1 deletions
|
@ -4,6 +4,12 @@
|
|||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.avif" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<meta name="og:title" content="TCL-Guessr" />
|
||||
<meta name="og:type" content="website" />
|
||||
<meta name="og:image" content="%sveltekit.assets%/favicon.avif" />
|
||||
<meta name="theme-color" content="#ff0000" />
|
||||
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<meta name="og:description" content="Tableau des scores" />
|
||||
<title>Tableau des scores</title>
|
||||
</svelte:head>
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import { error } from "@sveltejs/kit";
|
|||
|
||||
interface JoinedRoundScore {
|
||||
mode: string;
|
||||
stops_type: string;
|
||||
total_score: number;
|
||||
name: string;
|
||||
points: number;
|
||||
|
@ -19,7 +20,7 @@ export const load: PageServerLoad = async ({ locals, url, platform }) => {
|
|||
|
||||
const { results } = await db
|
||||
.prepare(
|
||||
"SELECT game.mode, game.total_score, user.name, round.points, round.distance, round.stop_name FROM game INNER JOIN round ON round.game_id = game.id LEFT JOIN user ON user.id = game.user_id WHERE game.id = ?;",
|
||||
"SELECT game.mode, game.stops_type, game.total_score, user.name, round.points, round.distance, round.stop_name FROM game INNER JOIN round ON round.game_id = game.id LEFT JOIN user ON user.id = game.user_id WHERE game.id = ?;",
|
||||
)
|
||||
.bind(gameId)
|
||||
.all<JoinedRoundScore>();
|
||||
|
|
|
@ -9,12 +9,15 @@
|
|||
|
||||
const totalScore = props.data.rounds[0].total_score;
|
||||
const mode = props.data.rounds[0].mode;
|
||||
const stops_type = props.data.rounds[0].stops_type;
|
||||
const name = props.data.rounds[0].name;
|
||||
|
||||
const saveParams = new URLSearchParams({ next: `/api/save?id=${props.data.gameId}` });
|
||||
const ogDesc = `${totalScore} points par ${name ?? "inconnu"} - Difficulté: ${mode} - Arrêts: ${stops_type}`;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<meta name="og:description" content={ogDesc} />
|
||||
<title>TCL-Guessr - Résultats</title>
|
||||
</svelte:head>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue