fix: make the metadata consistent for all 404 Not Found pages

This commit is contained in:
Dorian Niemiec 2024-09-07 21:16:02 +02:00
parent 44d84586ec
commit 7138b618e4
3 changed files with 30 additions and 2 deletions

View file

@ -51,8 +51,13 @@ export async function generateMetadata({
if (!data) { if (!data) {
return { return {
title: "Not Found", title: "404 Not Found - SVR.JS",
description: "Blog post not found" openGraph: {
title: "404 Not Found - SVR.JS"
},
twitter: {
title: "404 Not Found - SVR.JS"
}
}; };
} }

View file

@ -32,6 +32,18 @@ export async function generateMetadata({
} }
} catch (err) {} } catch (err) {}
if (notFound) {
return {
title: "404 Not Found - SVR.JS",
openGraph: {
title: "404 Not Found - SVR.JS"
},
twitter: {
title: "404 Not Found - SVR.JS"
}
};
}
return { return {
title: `${page.title} change log - SVR.JS`, title: `${page.title} change log - SVR.JS`,
description: `Keep track of the latest updates and improvements for ${page.title} with our comprehensive change log. Discover new features, bug fixes, and enhancements for each release of this SVR.JS mod.`, description: `Keep track of the latest updates and improvements for ${page.title} with our comprehensive change log. Discover new features, bug fixes, and enhancements for each release of this SVR.JS mod.`,

View file

@ -1,7 +1,18 @@
import type { Metadata } from "next";
import Footer from "@/components/shared/Footer"; import Footer from "@/components/shared/Footer";
import Navbar from "@/components/shared/Navbar"; import Navbar from "@/components/shared/Navbar";
import Link from "next/link"; import Link from "next/link";
export const metadata: Metadata = {
title: "404 Not Found - SVR.JS",
openGraph: {
title: "404 Not Found - SVR.JS"
},
twitter: {
title: "404 Not Found - SVR.JS"
}
};
const NotFound = () => { const NotFound = () => {
return ( return (
<> <>