Template
The root layout exported no metadata, so routes without their own export rendered no title at all, and no route had a description. Add a root metadata block with a title template, Open Graph and Twitter defaults, and fill in the routes that were missing tags. - config/site.ts: description and env-driven absolute url for metadataBase - home, /collections and /shop/collections: titles and descriptions - products/[handle] and collections/[handle]: generateMetadata off the existing catalog fetchers, with canonical and OG image - existing titles: drop the hand-written " — Shop" suffix now that the root template appends it Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011x5jT4fJJCnqPx3umEvXRk
20 lines
580 B
TypeScript
20 lines
580 B
TypeScript
import type { Metadata } from 'next';
|
|
import Products from '@/components/shopify/products';
|
|
import { site } from '@/config/site';
|
|
|
|
// The home page keeps the bare store name, so `title.absolute` opts out of the
|
|
// root template rather than rendering "Shop — Shop".
|
|
export const metadata: Metadata = {
|
|
title: { absolute: site.storeName },
|
|
description: site.description,
|
|
};
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Products
|
|
title="Shopify Hydrogen Storefront"
|
|
subtitle="An agent-friendly Shopify storefront built with Next.js and Hydrogen."
|
|
/>
|
|
);
|
|
}
|