diff --git a/apps/www/app/blog/BlogClient.tsx b/apps/www/app/blog/BlogClient.tsx index cc5c8780add..5142095c7b1 100644 --- a/apps/www/app/blog/BlogClient.tsx +++ b/apps/www/app/blog/BlogClient.tsx @@ -1,16 +1,15 @@ 'use client' import { useEffect, useState } from 'react' -import { NextSeo } from 'next-seo' -import DefaultLayout from '~/components/Layouts/Default' -import BlogGridItem from '~/components/Blog/BlogGridItem' -import BlogListItem from '~/components/Blog/BlogListItem' -import BlogFilters from '~/components/Blog/BlogFilters' -import FeaturedThumb from '~/components/Blog/FeaturedThumb' +import DefaultLayout from 'components/Layouts/Default' +import BlogGridItem from 'components/Blog/BlogGridItem' +import BlogListItem from 'components/Blog/BlogListItem' +import BlogFilters from 'components/Blog/BlogFilters' +import FeaturedThumb from 'components/Blog/FeaturedThumb' import { cn } from 'ui' import { LOCAL_STORAGE_KEYS, isBrowser } from 'common' -import type PostTypes from '~/types/post' +import type PostTypes from 'types/post' export type BlogView = 'list' | 'grid' @@ -51,27 +50,6 @@ export default function BlogClient(props: { blogs: any[] }) { return ( <> -

Supabase blog

diff --git a/apps/www/app/blog/[slug]/BlogPostClient.tsx b/apps/www/app/blog/[slug]/BlogPostClient.tsx index aed4ce25857..2faa5060b93 100644 --- a/apps/www/app/blog/[slug]/BlogPostClient.tsx +++ b/apps/www/app/blog/[slug]/BlogPostClient.tsx @@ -1,7 +1,6 @@ 'use client' import dynamic from 'next/dynamic' -import { NextSeo } from 'next-seo' import { useState, useMemo } from 'react' import { useLivePreview } from '@payloadcms/live-preview-react' @@ -90,37 +89,7 @@ export default function BlogPostClient(props: BlogPostPageProps) { return ( <> - + {/* Head metadata handled at layout/page level now */} ({ category })) } +export async function generateMetadata({ params }: { params: Params }): Promise { + const capitalizedCategory = startCase(params.category.replaceAll('-', ' ')) + return { + title: `Blog | ${capitalizedCategory}`, + description: 'Latest news from the Supabase team.', + } +} + export default async function CategoriesPage({ params }: { params: Params }) { const blogs = getSortedPosts({ directory: '_blog', @@ -23,10 +31,6 @@ export default async function CategoriesPage({ params }: { params: Params }) { return ( <> -
diff --git a/apps/www/app/blog/page.tsx b/apps/www/app/blog/page.tsx index d6e73b151dc..78b16351d58 100644 --- a/apps/www/app/blog/page.tsx +++ b/apps/www/app/blog/page.tsx @@ -1,10 +1,22 @@ import fs from 'fs' +import type { Metadata } from 'next' import { generateRss } from 'lib/rss' import { getSortedPosts } from 'lib/posts' -import BlogClient from 'app/blog/BlogClient' +import BlogClient from './BlogClient' export const dynamic = 'force-static' +export const metadata: Metadata = { + title: 'Supabase Blog: the Postgres development platform', + description: 'Get all your Supabase News on the Supabase blog.', + openGraph: { + title: 'Supabase Blog: the Postgres development platform', + description: 'Get all your Supabase News on the Supabase blog.', + url: 'https://supabase.com/blog', + images: [{ url: 'https://supabase.com/images/og/supabase-og.png' }], + }, +} + export default async function BlogPage() { // Get static blog posts at build time const staticPostsData = getSortedPosts({ directory: '_blog', runner: '** BLOG PAGE **' }) diff --git a/apps/www/app/blog/tags/[tag]/page.tsx b/apps/www/app/blog/tags/[tag]/page.tsx index 42ecccf72d7..f25391ff86c 100644 --- a/apps/www/app/blog/tags/[tag]/page.tsx +++ b/apps/www/app/blog/tags/[tag]/page.tsx @@ -1,4 +1,4 @@ -import { NextSeo } from 'next-seo' +import type { Metadata } from 'next' import { getSortedPosts, getAllTags } from '~/lib/posts' import Link from 'next/link' import { startCase } from 'lodash' @@ -13,6 +13,14 @@ export async function generateStaticParams() { return tags.map((tag: string) => ({ tag })) } +export async function generateMetadata({ params }: { params: Params }): Promise { + const capitalizedTag = startCase(params.tag.replaceAll('-', ' ')) + return { + title: `Blog | ${capitalizedTag}`, + description: 'Latest news from the Supabase team.', + } +} + export default async function TagPage({ params }: { params: Params }) { const blogs = getSortedPosts({ directory: '_blog', @@ -23,10 +31,6 @@ export default async function TagPage({ params }: { params: Params }) { return ( <> -
diff --git a/apps/www/app/providers.tsx b/apps/www/app/providers.tsx index f547bd7fb64..b1155712818 100644 --- a/apps/www/app/providers.tsx +++ b/apps/www/app/providers.tsx @@ -5,15 +5,15 @@ import { FeatureFlagProvider, IS_PLATFORM, PageTelemetry, + TelemetryTagManager, ThemeProvider, useThemeSandbox, - TelemetryTagManager, } from 'common' +import { WwwCommandMenu } from 'components/CommandMenu' +import { API_URL } from 'lib/constants' import { themes, TooltipProvider, SonnerToaster } from 'ui' import { CommandProvider } from 'ui-patterns/CommandMenu' import { useConsentToast } from 'ui-patterns/consent' -import { API_URL } from '~/lib/constants' -import { WwwCommandMenu } from '~/components/CommandMenu' function Providers({ children }: { children: React.ReactNode }) { useThemeSandbox() diff --git a/apps/www/components/Charts/PGCharts.tsx b/apps/www/components/Charts/PGCharts.tsx index 3297eab4e9b..6fb44ed8f98 100644 --- a/apps/www/components/Charts/PGCharts.tsx +++ b/apps/www/components/Charts/PGCharts.tsx @@ -1,3 +1,5 @@ +'use client' + import { Tabs } from 'ui' import { useState } from 'react' import ReactMarkdown from 'react-markdown' diff --git a/apps/www/components/CodeBlock/CodeBlock.tsx b/apps/www/components/CodeBlock/CodeBlock.tsx index 3d4a6c44c6d..7e333ab0d4b 100644 --- a/apps/www/components/CodeBlock/CodeBlock.tsx +++ b/apps/www/components/CodeBlock/CodeBlock.tsx @@ -1,3 +1,5 @@ +'use client' + import { Check, Copy, File, Terminal } from 'lucide-react' import { useTheme } from 'next-themes' import { useEffect, useState } from 'react' diff --git a/apps/www/components/ImageFadeStack.tsx b/apps/www/components/ImageFadeStack.tsx index 6f1182f00bc..22d61fdb346 100644 --- a/apps/www/components/ImageFadeStack.tsx +++ b/apps/www/components/ImageFadeStack.tsx @@ -1,3 +1,5 @@ +'use client' + import { PauseCircle, PlayCircle } from 'lucide-react' import Image from 'next/image' import { useEffect, useState } from 'react' diff --git a/apps/www/components/ImageGrid.tsx b/apps/www/components/ImageGrid.tsx index cbb9becf428..c201def4fbf 100644 --- a/apps/www/components/ImageGrid.tsx +++ b/apps/www/components/ImageGrid.tsx @@ -1,3 +1,5 @@ +'use client' + import Image from 'next/image' import Link from 'next/link' import { motion } from 'framer-motion' diff --git a/apps/www/contentlayer.config.ts b/apps/www/contentlayer.config.ts index 13ab0eff9d7..3b736d1fbd6 100644 --- a/apps/www/contentlayer.config.ts +++ b/apps/www/contentlayer.config.ts @@ -4,7 +4,7 @@ import { FILENAME_SUBSTRING } from './lib/posts' export const BlogPost = defineDocumentType(() => ({ name: 'BlogPost', filePathPattern: `**/*.mdx`, - // contentType: 'mdx', + contentType: 'mdx', fields: { date: { type: 'string', required: true }, description: { type: 'string', required: true }, @@ -13,6 +13,12 @@ export const BlogPost = defineDocumentType(() => ({ tags: { type: 'list', of: { type: 'string' }, required: false }, title: { type: 'string', required: true }, thumb: { type: 'string', required: false }, + author: { type: 'string', required: true }, + author_title: { type: 'string', required: false }, + author_url: { type: 'string', required: false }, + author_image_url: { type: 'string', required: false }, + video: { type: 'string', required: false }, + toc_depth: { type: 'number', required: false }, }, computedFields: { url: { diff --git a/apps/www/lib/mdx/mdxComponents.tsx b/apps/www/lib/mdx/mdxComponents.tsx index cf555dfc951..901767347af 100644 --- a/apps/www/lib/mdx/mdxComponents.tsx +++ b/apps/www/lib/mdx/mdxComponents.tsx @@ -1,3 +1,5 @@ +'use client' + import { PropsWithChildren } from 'react' import { CH } from '@code-hike/mdx/components' import dynamic from 'next/dynamic' diff --git a/apps/www/next.config.mjs b/apps/www/next.config.mjs index 81ff76153b7..857c317ca70 100644 --- a/apps/www/next.config.mjs +++ b/apps/www/next.config.mjs @@ -125,9 +125,6 @@ const nextConfig = { // We are already running linting via GH action, this will skip linting during production build on Vercel. ignoreDuringBuilds: true, }, - outputFileTracingExcludes: { - '*': ['.contentlayer/generated/BlogPost/**/*'], - }, } // next.config.js.