update /product URL to /products to support meta commerce integrations and shopify SEO

This commit is contained in:
Alex 2023-05-19 12:18:26 +01:00
parent 50b4e6cbc6
commit c473bc8224
6 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ export default async function sitemap(): Promise<Promise<Promise<MetadataRoute.S
const productsPromise = getProducts({}).then((products) =>
products.map((product) => ({
url: `${baseUrl}/product/${product.handle}`,
url: `${baseUrl}/products/${product.handle}`,
lastModified: product.updatedAt
}))
);

View File

@ -14,7 +14,7 @@ export async function Carousel() {
{[...products, ...products].map((product, i) => (
<Link
key={`${product.handle}${i}`}
href={`/product/${product.handle}`}
href={`/products/${product.handle}`}
className="relative h-[30vh] w-1/2 flex-none md:w-1/3"
>
{product.featuredImage ? (

View File

@ -89,7 +89,7 @@ export default function CartModal({
});
const merchandiseUrl = createUrl(
`/product/${item.merchandise.product.handle}`,
`/products/${item.merchandise.product.handle}`,
new URLSearchParams(merchandiseSearchParams)
);

View File

@ -16,7 +16,7 @@ function ThreeItemGridItem({
<div
className={size === 'full' ? 'lg:col-span-4 lg:row-span-2' : 'lg:col-span-2 lg:row-span-1'}
>
<Link className="block h-full" href={`/product/${item.handle}`}>
<Link className="block h-full" href={`/products/${item.handle}`}>
<GridTileImage
src={item.featuredImage.url}
width={size === 'full' ? 1080 : 540}

View File

@ -8,7 +8,7 @@ export default function ProductGridItems({ products }: { products: Product[] })
<>
{products.map((product) => (
<Grid.Item key={product.handle} className="animate-fadeIn">
<Link className="h-full w-full" href={`/product/${product.handle}`}>
<Link className="h-full w-full" href={`/products/${product.handle}`}>
<GridTileImage
alt={product.title}
labels={{