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:
@@ -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,
|
||||
}: {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user