mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-28 08:59:40 +05:00
feat: add view of release name, description, image, author, releases in lists and releases in collection
This commit is contained in:
parent
3de552f271
commit
9a5d1eb6bd
4 changed files with 256 additions and 0 deletions
33
app/collection/[id]/page.tsx
Normal file
33
app/collection/[id]/page.tsx
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { ViewCollectionPage } from "#/pages/ViewCollection";
|
||||
import { fetchDataViaGet } from "#/api/utils";
|
||||
import type { Metadata, ResolvingMetadata } from "next";
|
||||
|
||||
export async function generateMetadata(
|
||||
{ params },
|
||||
parent: ResolvingMetadata
|
||||
): Promise<Metadata> {
|
||||
const id = params.id;
|
||||
const collection = await fetchDataViaGet(
|
||||
`https://api.anixart.tv/collection/${id}`
|
||||
);
|
||||
const previousOG = (await parent).openGraph;
|
||||
|
||||
return {
|
||||
title: "коллекция - " + collection.collection.title,
|
||||
description: collection.collection.description,
|
||||
openGraph: {
|
||||
...previousOG,
|
||||
images: [
|
||||
{
|
||||
url: collection.collection.image, // Must be an absolute URL
|
||||
width: 600,
|
||||
height: 800,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Collections({ params }) {
|
||||
return <ViewCollectionPage id={params.id} />;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue