mirror of
https://github.com/vercel/commerce.git
synced 2025-05-20 00:16:59 +00:00
Updates logo and fixes OG images
This commit is contained in:
parent
f4d542b4b8
commit
eb9e65ff79
@ -21,13 +21,6 @@ export async function generateMetadata({
|
|||||||
title: page.seo?.title || page.title,
|
title: page.seo?.title || page.title,
|
||||||
description: page.seo?.description || page.bodySummary,
|
description: page.seo?.description || page.bodySummary,
|
||||||
openGraph: {
|
openGraph: {
|
||||||
images: [
|
|
||||||
{
|
|
||||||
url: `/api/og?title=${encodeURIComponent(page.title)}`,
|
|
||||||
width: 1200,
|
|
||||||
height: 630
|
|
||||||
}
|
|
||||||
],
|
|
||||||
publishedTime: page.createdAt,
|
publishedTime: page.createdAt,
|
||||||
modifiedTime: page.updatedAt,
|
modifiedTime: page.updatedAt,
|
||||||
type: 'article'
|
type: 'article'
|
||||||
|
@ -8,13 +8,6 @@ export const runtime = 'edge';
|
|||||||
export const metadata = {
|
export const metadata = {
|
||||||
description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopify.',
|
description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopify.',
|
||||||
openGraph: {
|
openGraph: {
|
||||||
images: [
|
|
||||||
{
|
|
||||||
url: `/api/og?title=${encodeURIComponent(process.env.SITE_NAME || '')}`,
|
|
||||||
width: 1200,
|
|
||||||
height: 630
|
|
||||||
}
|
|
||||||
],
|
|
||||||
type: 'website'
|
type: 'website'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -31,6 +31,7 @@ export function GridTileImage({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{props.src ? (
|
{props.src ? (
|
||||||
|
// eslint-disable-next-line jsx-a11y/alt-text
|
||||||
<Image
|
<Image
|
||||||
className={clsx('relative h-full w-full object-contain', {
|
className={clsx('relative h-full w-full object-contain', {
|
||||||
'transition duration-300 ease-in-out hover:scale-105': isInteractive
|
'transition duration-300 ease-in-out hover:scale-105': isInteractive
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
|
|
||||||
export default function LogoIcon({ className }: { className?: string }) {
|
export default function LogoIcon(props: React.ComponentProps<'svg'>) {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
aria-label={`${process.env.SITE_NAME} logo`}
|
aria-label={`${process.env.SITE_NAME} logo`}
|
||||||
viewBox="0 0 32 32"
|
viewBox="0 0 32 28"
|
||||||
strokeWidth="1.5"
|
{...props}
|
||||||
strokeLinecap="round"
|
className={clsx('h-4 w-4 fill-black dark:fill-white', props.className)}
|
||||||
strokeLinejoin="round"
|
|
||||||
shapeRendering="geometricPrecision"
|
|
||||||
className={clsx('h-4 w-4', className)}
|
|
||||||
>
|
>
|
||||||
<path
|
<path d="M21.5758 9.75769L16 0L0 28H11.6255L21.5758 9.75769Z" />
|
||||||
className=" fill-black dark:fill-white"
|
<path d="M26.2381 17.9167L20.7382 28H32L26.2381 17.9167Z" />
|
||||||
d="M19.1999 7.59974L16 2L0 30H6.32501L19.1999 7.59974ZM23.2351 14.6614L20.035 20.3476L22.3566 24.4108H17.7482L14.6025 30H32L23.2351 14.6614Z"
|
|
||||||
/>
|
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,19 @@ export default function LogoSquare({ size }: { size?: 'sm' | undefined }) {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'flex flex-none items-center justify-center border border-neutral-200 dark:border-neutral-700',
|
'flex flex-none items-center justify-center border border-neutral-200 bg-white dark:border-neutral-700 dark:bg-black',
|
||||||
{
|
{
|
||||||
'h-[40px] w-[40px] rounded-xl': !size,
|
'h-[40px] w-[40px] rounded-xl': !size,
|
||||||
'h-[30px] w-[30px] rounded-lg': size === 'sm'
|
'h-[30px] w-[30px] rounded-lg': size === 'sm'
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<LogoIcon className="h-3 w-3" />
|
<LogoIcon
|
||||||
|
className={clsx({
|
||||||
|
'h-[16px] w-[16px]': !size,
|
||||||
|
'h-[10px] w-[10px]': size === 'sm'
|
||||||
|
})}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { ImageResponse } from 'next/server';
|
import { ImageResponse } from 'next/server';
|
||||||
|
import LogoIcon from './icons/logo';
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
title?: string;
|
title?: string;
|
||||||
@ -15,15 +16,9 @@ export default async function OpengraphImage(props?: Props): Promise<ImageRespon
|
|||||||
return new ImageResponse(
|
return new ImageResponse(
|
||||||
(
|
(
|
||||||
<div tw="flex h-full w-full flex-col items-center justify-center bg-black">
|
<div tw="flex h-full w-full flex-col items-center justify-center bg-black">
|
||||||
<svg viewBox="0 0 32 32" width="140">
|
<div tw="flex flex-none items-center justify-center border border-neutral-700 h-[160px] w-[160px] rounded-3xl">
|
||||||
<rect width="100%" height="100%" rx="16" fill="white" />
|
<LogoIcon width="64" height="58" fill="white" />
|
||||||
<path
|
</div>
|
||||||
fillRule="evenodd"
|
|
||||||
clipRule="evenodd"
|
|
||||||
fill="black"
|
|
||||||
d="M17.6482 10.1305L15.8785 7.02583L7.02979 22.5499H10.5278L17.6482 10.1305ZM19.8798 14.0457L18.11 17.1983L19.394 19.4511H16.8453L15.1056 22.5499H24.7272L19.8798 14.0457Z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
<p tw="mt-12 text-6xl font-bold text-white">{title}</p>
|
<p tw="mt-12 text-6xl font-bold text-white">{title}</p>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user