add meta description for world page
This commit is contained in:
parent
ae45b29e93
commit
d31c88115a
7 changed files with 36 additions and 13 deletions
|
@ -1,5 +1,6 @@
|
|||
import { json, type V2_MetaFunction } from "@remix-run/cloudflare";
|
||||
import { useLoaderData } from "@remix-run/react";
|
||||
import { IndexWorld } from "~/components/index-world";
|
||||
import type { IndexResponse } from "~/utils/saerro";
|
||||
import { indexQuery } from "~/utils/saerro";
|
||||
|
||||
|
@ -17,15 +18,9 @@ export default function Index() {
|
|||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>PS2.LIVE</h1>
|
||||
<h2>Worlds</h2>
|
||||
<ul>
|
||||
{data.allWorlds.map((world) => (
|
||||
<li key={world.id}>
|
||||
<a href={`/worlds/${world.id}`}>{world.name}</a> -{" "}
|
||||
{world.population.total} players ({world.population.vs} VS,{" "}
|
||||
{world.population.nc} NC, {world.population.tr} TR)
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{data.allWorlds.map((world) => (
|
||||
<IndexWorld key={world.id} world={world} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,12 @@ export const loader = async ({ params }: LoaderArgs) => {
|
|||
};
|
||||
|
||||
export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
|
||||
return [{ title: `${data?.world.name || "Unknown world"} | PS2.LIVE` }];
|
||||
return [
|
||||
{ title: `${data?.world.name || "Unknown world"} | PS2.LIVE` },
|
||||
{
|
||||
description: `${data?.world.name} currently has ${data?.world.population.total} players online right now. VS: ${data?.world.population.vs}, NC: ${data?.world.population.nc}, TR: ${data?.world.population.tr} -- See more detailed stats on ps2.live.`,
|
||||
},
|
||||
];
|
||||
};
|
||||
|
||||
export default function World() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue