Skip to content

Commit

Permalink
fix(nx-dev): update blog metadata to include the post descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
juristr committed Feb 4, 2025
1 parent 7a5c7ac commit da06d92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
2 changes: 1 addition & 1 deletion nx-dev/nx-dev/app/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function generateMetadata(

return {
title: `${post.title} | Nx Blog`,
description: 'Latest news from the Nx & Nx Cloud core team',
description: post.description,
openGraph: {
url: `https://nx.dev/blog/${slug}`,
title: post.title,
Expand Down
26 changes: 1 addition & 25 deletions nx-dev/ui-blog/src/lib/blog-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@ export interface BlogDetailsProps {
post: BlogPostDataEntry;
}

export async function generateMetadata({ post }: BlogDetailsProps) {
return {
title: post.title,
description: post.description,
openGraph: {
images: [
{
url: post.cover_image
? `https://nx.dev${post.cover_image}`
: 'https://nx.dev/socials/nx-media.png',
width: 800,
height: 421,
alt: 'Nx: Smart Monorepos · Fast CI',
type: 'image/jpeg',
},
],
},
};
}

export function BlogDetails({ post }: BlogDetailsProps) {
const { node } = renderMarkdown(post.content, {
filePath: post.filePath ?? '',
Expand Down Expand Up @@ -79,11 +59,7 @@ export function BlogDetails({ post }: BlogDetailsProps) {
</div>
) : post.youtubeUrl ? (
<div className="mx-auto mb-16 w-full max-w-screen-md">
<YouTube
src={post.youtubeUrl}
title={post.title}
caption={post.description}
/>
<YouTube src={post.youtubeUrl} title={post.title} />
</div>
) : (
post.cover_image && (
Expand Down

0 comments on commit da06d92

Please sign in to comment.