1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-05 20:15:31 -04:00

attempt to fix metadata merging

This commit is contained in:
2025-04-22 22:17:32 -04:00
parent fe055116d5
commit 6c3cd0afe9
25 changed files with 411 additions and 413 deletions
+5 -7
View File
@@ -9,7 +9,7 @@ import Comments from "../../../components/Comments";
import Loading from "../../../components/Loading";
import HitCounter from "./counter";
import { getSlugs, getFrontMatter } from "../../../lib/helpers/posts";
import { addMetadata } from "../../../lib/helpers/metadata";
import { createMetadata } from "../../../lib/helpers/metadata";
import * as config from "../../../lib/config";
import { POSTS_DIR } from "../../../lib/config/constants";
import { size as ogImageSize } from "./opengraph-image";
@@ -37,9 +37,10 @@ export const generateMetadata = async ({ params }: { params: Promise<{ slug: str
const { slug } = await params;
const frontmatter = await getFrontMatter(slug);
return addMetadata({
return createMetadata({
title: frontmatter!.title,
description: frontmatter!.description,
canonical: `/${POSTS_DIR}/${slug}`,
openGraph: {
type: "article",
authors: [config.authorName],
@@ -50,9 +51,6 @@ export const generateMetadata = async ({ params }: { params: Promise<{ slug: str
twitter: {
card: "summary_large_image",
},
alternates: {
canonical: `/${POSTS_DIR}/${slug}`,
},
});
};
@@ -63,7 +61,7 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
const { default: MDXContent } = await import(`../../../${POSTS_DIR}/${slug}/index.mdx`);
return (
<>
<article>
<JsonLd<BlogPosting>
item={{
"@context": "https://schema.org",
@@ -155,7 +153,7 @@ const Page = async ({ params }: { params: Promise<{ slug: string }> }) => {
</Suspense>
</div>
)}
</>
</article>
);
};