1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-05 15:45:27 +01:00

Add metadata (title etc.) to blog pages

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz
2025-05-20 22:00:31 +02:00
parent d0cba7df41
commit c83808a7e8
2 changed files with 25 additions and 0 deletions

View File

@@ -7,6 +7,21 @@ export async function generateStaticParams() {
return getAllPostParams();
}
export async function generateMetadata({
params,
}: {
params: Promise<{ year: string; month: string; day: string; slug: string }>;
}) {
const { frontmatter } = getPost(await params);
return {
title: `${frontmatter.title} | Prometheus`,
openGraph: {
title: `${frontmatter.title} | Prometheus`,
url: `https://prometheus.io/blog/${frontmatter.slug}`,
},
};
}
export default async function BlogPostPage({
params,
}: {

View File

@@ -4,6 +4,16 @@ import { Anchor, Title, Text, Card, Stack, Button, Box } from "@mantine/core";
import dayjs from "dayjs";
import Link from "next/link";
export async function generateMetadata() {
return {
title: "Blog | Prometheus",
openGraph: {
title: "Blog | Prometheus",
url: "https://prometheus.io/blog",
},
};
}
export default function BlogPage() {
const allPosts = getAllPosts();