add embed
All checks were successful
deploy / deploy (push) Successful in 53s

This commit is contained in:
Lee 2023-10-27 16:36:40 +01:00
parent b9205cbdb6
commit 1a0d9afb82

View File

@ -1,13 +1,10 @@
import AnalyticsChart from "@/components/AnalyticsChart";
import Card from "@/components/Card";
import Container from "@/components/Container";
import { ScoresaberPlayerCountHistory } from "@/schemas/fascinated/scoresaberPlayerCountHistory";
import { ssrSettings } from "@/ssrSettings";
import { Metadata } from "next";
export const metadata: Metadata = {
title: "Search",
};
async function getData() {
const response = await fetch(
"https://bs-tracker.fascinated.cc/analytics?time=30d",
@ -19,7 +16,26 @@ async function getData() {
);
const json = await response.json();
return json;
return json as ScoresaberPlayerCountHistory;
}
export async function generateMetadata(): Promise<Metadata> {
const data = await getData();
const description = "View Scoresaber metrics and statistics over time.";
return {
title: `Analytics`,
description: description,
openGraph: {
siteName: ssrSettings.siteName,
title: `Analytics`,
description:
description +
`
Players currently online: ${data.history[data.history.length - 1].value}`,
},
};
}
export default async function Analytics() {