File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import Link from 'next/link';
33export const metadata = {
44 title : 'About - Teerank' ,
55 description : 'Teerank is a simple and fast ranking system for Teeworlds.' ,
6+ alternates : {
7+ canonical : 'https://teerank.io/about' ,
8+ } ,
69} ;
710
811export default function Index ( ) {
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import { searchParamSchema } from '../schema';
77export const metadata = {
88 title : 'All Clans - Teerank' ,
99 description : 'Teerank is a simple and fast ranking system for Teeworlds.' ,
10+ alternates : {
11+ canonical : 'https://teerank.io/all/clans' ,
12+ } ,
1013} ;
1114
1215export default async function Index ( {
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import redis from '../../utils/redis';
77export const metadata = {
88 title : 'All Players - Teerank' ,
99 description : 'Teerank is a simple and fast ranking system for Teeworlds.' ,
10+ alternates : {
11+ canonical : 'https://teerank.io/all' ,
12+ } ,
1013} ;
1114
1215export default async function Index ( {
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import redis from '../../../utils/redis';
77export const metadata = {
88 title : 'All Servers - Teerank' ,
99 description : 'Teerank is a simple and fast ranking system for Teeworlds.' ,
10+ alternates : {
11+ canonical : 'https://teerank.io/all/servers' ,
12+ } ,
1013} ;
1114
1215export default async function Index ( {
Original file line number Diff line number Diff line change @@ -4,11 +4,24 @@ import { notFound } from 'next/navigation';
44import prisma from '../../../../utils/prisma' ;
55import { GameTypeList } from '../../../../components/GameTypeList' ;
66import { searchParamPageSchema } from '../../../../utils/page' ;
7+ import { encodeString } from '../../../../utils/encoding' ;
8+ import { Metadata } from 'next' ;
79
8- export const metadata = {
9- title : 'Clan - Game types' ,
10- description : 'A Teeworlds clan' ,
11- } ;
10+ export async function generateMetadata ( {
11+ params,
12+ } : {
13+ params : z . infer < typeof paramsSchema > ;
14+ } ) : Promise < Metadata > {
15+ const { clanName } = paramsSchema . parse ( params ) ;
16+
17+ return {
18+ title : `Clan ${ clanName } - Maps` ,
19+ description : `List of ranked maps for ${ clanName } ` ,
20+ alternates : {
21+ canonical : `https://teerank.io/clan/${ encodeString ( clanName ) } /gametypes` ,
22+ } ,
23+ } ;
24+ }
1225
1326export default async function Index ( {
1427 params,
Original file line number Diff line number Diff line change @@ -4,11 +4,24 @@ import { notFound } from 'next/navigation';
44import prisma from '../../../../utils/prisma' ;
55import { searchParamPageSchema } from '../../../../utils/page' ;
66import { MapList } from '../../../../components/MapList' ;
7+ import { encodeString } from '../../../../utils/encoding' ;
8+ import { Metadata } from 'next' ;
79
8- export const metadata = {
9- title : 'Clan - Maps' ,
10- description : 'A Teeworlds clan' ,
11- } ;
10+ export async function generateMetadata ( {
11+ params,
12+ } : {
13+ params : z . infer < typeof paramsSchema > ;
14+ } ) : Promise < Metadata > {
15+ const { clanName } = paramsSchema . parse ( params ) ;
16+
17+ return {
18+ title : `Clan ${ clanName } - Maps` ,
19+ description : `List of ranked maps for ${ clanName } ` ,
20+ alternates : {
21+ canonical : `https://teerank.io/clan/${ encodeString ( clanName ) } /maps` ,
22+ } ,
23+ } ;
24+ }
1225
1326export default async function Index ( {
1427 params,
Original file line number Diff line number Diff line change @@ -4,11 +4,24 @@ import { notFound } from 'next/navigation';
44import prisma from '../../../utils/prisma' ;
55import { PlayerList } from '../../../components/PlayerList' ;
66import { searchParamPageSchema } from '../../../utils/page' ;
7+ import { Metadata } from 'next' ;
8+ import { encodeString } from '../../../utils/encoding' ;
79
8- export const metadata = {
9- title : 'Clan' ,
10- description : 'A Teeworlds clan' ,
11- } ;
10+ export async function generateMetadata ( {
11+ params,
12+ } : {
13+ params : z . infer < typeof paramsSchema > ;
14+ } ) : Promise < Metadata > {
15+ const { clanName } = paramsSchema . parse ( params ) ;
16+
17+ return {
18+ title : `Clan ${ clanName } ` ,
19+ description : `List of ranked players for ${ clanName } ` ,
20+ alternates : {
21+ canonical : `https://teerank.io/clan/${ encodeString ( clanName ) } ` ,
22+ } ,
23+ } ;
24+ }
1225
1326export default async function Index ( {
1427 params,
Original file line number Diff line number Diff line change 1+ import { Metadata } from 'next' ;
12import { ClanList } from '../../../../../components/ClanList' ;
3+ import { encodeString } from '../../../../../utils/encoding' ;
24import prisma from '../../../../../utils/prisma' ;
35import { paramsSchema , searchParamsSchema } from '../../schema' ;
46import { notFound } from 'next/navigation' ;
7+ import { z } from 'zod' ;
58
6- export const metadata = {
7- title : 'Clans' ,
8- description : 'List of ranked clans' ,
9- } ;
9+ export async function generateMetadata ( {
10+ params,
11+ } : {
12+ params : z . infer < typeof paramsSchema > ;
13+ } ) : Promise < Metadata > {
14+ const { gameTypeName } = paramsSchema . parse ( params ) ;
15+
16+ return {
17+ title : `Gametype ${ gameTypeName } ` ,
18+ description : `List of ranked clans for ${ gameTypeName } ` ,
19+ alternates : {
20+ canonical : `https://teerank.io/gametype/${ encodeString ( gameTypeName ) } /clans` ,
21+ } ,
22+ } ;
23+ }
1024
1125export default async function Index ( {
1226 params,
Original file line number Diff line number Diff line change @@ -3,11 +3,25 @@ import { PlayerList } from '../../../../components/PlayerList';
33import prisma from '../../../../utils/prisma' ;
44import { paramsSchema , searchParamsSchema } from '../schema' ;
55import { notFound } from 'next/navigation' ;
6+ import { encodeString } from '../../../../utils/encoding' ;
7+ import { Metadata } from 'next' ;
8+ import { z } from 'zod' ;
69
7- export const metadata = {
8- title : 'Players' ,
9- description : 'List of ranked players' ,
10- } ;
10+ export async function generateMetadata ( {
11+ params,
12+ } : {
13+ params : z . infer < typeof paramsSchema > ;
14+ } ) : Promise < Metadata > {
15+ const { gameTypeName } = paramsSchema . parse ( params ) ;
16+
17+ return {
18+ title : `Gametype ${ gameTypeName } ` ,
19+ description : `List of ranked players for ${ gameTypeName } ` ,
20+ alternates : {
21+ canonical : `https://teerank.io/gametype/${ encodeString ( gameTypeName ) } ` ,
22+ } ,
23+ } ;
24+ }
1125
1226export default async function Index ( {
1327 params,
Original file line number Diff line number Diff line change 1+ import { Metadata } from 'next' ;
12import { ServerList } from '../../../../../components/ServerList' ;
3+ import { encodeString } from '../../../../../utils/encoding' ;
24import prisma from '../../../../../utils/prisma' ;
35import { paramsSchema , searchParamsSchema } from '../../schema' ;
6+ import { z } from 'zod' ;
47
5- export const metadata = {
6- title : 'Servers' ,
7- description : 'List of ranked servers' ,
8- } ;
8+ export async function generateMetadata ( {
9+ params,
10+ } : {
11+ params : z . infer < typeof paramsSchema > ;
12+ } ) : Promise < Metadata > {
13+ const { gameTypeName } = paramsSchema . parse ( params ) ;
14+
15+ return {
16+ title : `Gametype ${ gameTypeName } ` ,
17+ description : `List of ranked servers for ${ gameTypeName } ` ,
18+ alternates : {
19+ canonical : `https://teerank.io/gametype/${ encodeString ( gameTypeName ) } /servers` ,
20+ } ,
21+ } ;
22+ }
923
1024export default async function Index ( {
1125 params,
You can’t perform that action at this time.
0 commit comments