diff --git a/TODO.md b/TODO.md
index d59f27c..82b7b52 100644
--- a/TODO.md
+++ b/TODO.md
@@ -73,7 +73,7 @@
## Стиль
- [X] Тёмная тема
-- [ ] Больше метаданных для превью ссылки страницы
+- [X] Больше метаданных для превью ссылки страницы
## Баги
diff --git a/app/bookmarks/[slug]/page.tsx b/app/bookmarks/[slug]/page.tsx
index dd6ecf3..8edba6b 100644
--- a/app/bookmarks/[slug]/page.tsx
+++ b/app/bookmarks/[slug]/page.tsx
@@ -15,9 +15,6 @@ export async function generateMetadata({ params }) {
}
export default function Index({ params }) {
- const metadata = {
- title: "AniX | " + SectionTitleMapping[params.slug],
- };
return (
;
- }
-
\ No newline at end of file
+ title: "Закладки",
+};
+
+import { BookmarksPage } from "#/pages/Bookmarks";
+export default function Index() {
+ return ;
+}
diff --git a/app/home/[slug]/page.tsx b/app/home/[slug]/page.tsx
index 37845d4..56c6b40 100644
--- a/app/home/[slug]/page.tsx
+++ b/app/home/[slug]/page.tsx
@@ -14,9 +14,6 @@ export async function generateMetadata({ params }) {
}
export default function Index({ params }) {
- const metadata = {
- title: "AniX | " + SectionTitleMapping[params.slug],
- };
return (
Promise.resolve(LoginPage), {
ssr: false,
});
diff --git a/app/page.tsx b/app/page.tsx
index b4797ec..b54ae5b 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -1,7 +1,3 @@
-export const metadata = {
- title: "AniX | Домашняя",
-};
-
import { IndexPage } from "./pages/Index";
export default function Index() {
diff --git a/app/profile/[id]/page.tsx b/app/profile/[id]/page.tsx
index 644beca..888a377 100644
--- a/app/profile/[id]/page.tsx
+++ b/app/profile/[id]/page.tsx
@@ -1,12 +1,30 @@
import { ProfilePage } from "#/pages/Profile";
import { fetchDataViaGet } from "#/api/utils";
+import type { Metadata, ResolvingMetadata } from "next";
-export async function generateMetadata({ params }) {
- const id:string = params.id;
- const profile: any = await fetchDataViaGet(`https://api.anixart.tv/profile/${id}`);
+export async function generateMetadata(
+ { params },
+ parent: ResolvingMetadata
+): Promise {
+ const id: string = params.id;
+ const profile: any = await fetchDataViaGet(
+ `https://api.anixart.tv/profile/${id}`
+ );
+ const previousOG = (await parent).openGraph;
return {
- title: "Профиль " + profile.profile.login,
+ title: "Профиль - " + profile.profile.login,
+ description: profile.profile.status,
+ openGraph: {
+ ...previousOG,
+ images: [
+ {
+ url: profile.profile.avatar, // Must be an absolute URL
+ width: 600,
+ height: 600,
+ },
+ ],
+ },
};
}
diff --git a/app/related/[id]/page.tsx b/app/related/[id]/page.tsx
index 3e391e7..e9dec99 100644
--- a/app/related/[id]/page.tsx
+++ b/app/related/[id]/page.tsx
@@ -1,13 +1,26 @@
import { RelatedPage } from "#/pages/Related";
import { fetchDataViaGet } from "#/api/utils";
+import type { Metadata, ResolvingMetadata } from "next";
-export async function generateMetadata({ params }) {
+export async function generateMetadata({ params }, parent: ResolvingMetadata): Promise {
const id:string = params.id;
const related: any = await fetchDataViaGet(`https://api.anixart.tv/related/${id}/0`);
const firstRelease: any = await fetchDataViaGet(`https://api.anixart.tv/release/${related.content[0].id}`);
+ const previousOG = (await parent).openGraph;
return {
- title: "Франшиза " + firstRelease.release.related.name_ru || firstRelease.release.related.name,
+ title: "Франшиза - " + firstRelease.release.related.name_ru || firstRelease.release.related.name,
+ description: firstRelease.release.description,
+ openGraph: {
+ ...previousOG,
+ images: [
+ {
+ url: firstRelease.release.image, // Must be an absolute URL
+ width: 600,
+ height: 800,
+ },
+ ],
+ },
};
}
diff --git a/app/release/[id]/page.tsx b/app/release/[id]/page.tsx
index 6630a5c..25f2304 100644
--- a/app/release/[id]/page.tsx
+++ b/app/release/[id]/page.tsx
@@ -1,16 +1,32 @@
import { ReleasePage } from "#/pages/Release";
import { fetchDataViaGet } from "#/api/utils";
+import type { Metadata, ResolvingMetadata } from "next";
-export async function generateMetadata({ params }) {
- const id = params.id
+export async function generateMetadata(
+ { params },
+ parent: ResolvingMetadata
+): Promise {
+ const id = params.id;
const release = await fetchDataViaGet(`https://api.anixart.tv/release/${id}`);
+ const previousOG = (await parent).openGraph;
return {
title: release.release.title_ru,
+ description: release.release.description,
+ openGraph: {
+ ...previousOG,
+ images: [
+ {
+ url: release.release.image, // Must be an absolute URL
+ width: 600,
+ height: 800,
+ },
+ ],
+ },
};
}
export default async function Search({ params }) {
- const id = params.id
+ const id = params.id;
return ;
}
diff --git a/app/search/page.tsx b/app/search/page.tsx
index 0bec3c3..6a2c61a 100644
--- a/app/search/page.tsx
+++ b/app/search/page.tsx
@@ -1,8 +1,10 @@
import dynamic from "next/dynamic";
import { SearchPage } from "#/pages/Search";
+import { Metadata } from "next";
-export async function generateMetadata({ searchParams }) {
+export async function generateMetadata({ searchParams }): Promise {
const query = searchParams.q;
+
return {
title: query || "Поиск",
};
diff --git a/public/opengraph.png b/public/opengraph.png
new file mode 100644
index 0000000..5090ed8
Binary files /dev/null and b/public/opengraph.png differ