diff --git a/messages/en.json b/messages/en.json index 09a82e0..a08d7bd 100644 --- a/messages/en.json +++ b/messages/en.json @@ -227,26 +227,47 @@ "hero": { "title": "Hero Blocks" }, - "pricing": { - "title": "Pricing Blocks" + "logo": { + "title": "Logo Cloud Blocks" }, "features": { "title": "Features Blocks" }, - "faq": { - "title": "FAQ Blocks" - }, - "testimonials": { - "title": "Testimonials Blocks" + "content": { + "title": "Content Blocks" }, "stats": { "title": "Stats Blocks" }, + "team": { + "title": "Team Blocks" + }, + "testimonials": { + "title": "Testimonials Blocks" + }, "callToAction": { "title": "Call to Action Blocks" }, - "content": { - "title": "Content Blocks" + "footer": { + "title": "Footer Blocks" + }, + "pricing": { + "title": "Pricing Blocks" + }, + "comparator": { + "title": "Comparator Blocks" + }, + "faq": { + "title": "FAQ Blocks" + }, + "login": { + "title": "Login Blocks" + }, + "signup": { + "title": "Signup Blocks" + }, + "contact": { + "title": "Contact Blocks" } } } diff --git a/messages/zh.json b/messages/zh.json index 7c89956..468cdee 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -222,26 +222,47 @@ "hero": { "title": "Hero组件" }, - "pricing": { - "title": "Pricing组件" + "logoCloud": { + "title": "Logo Cloud组件" }, "features": { "title": "Features组件" }, - "faq": { - "title": "FAQ组件" - }, - "testimonials": { - "title": "Testimonials组件" + "content": { + "title": "Content组件" }, "stats": { "title": "Stats组件" }, + "team": { + "title": "Team组件" + }, + "testimonials": { + "title": "Testimonials组件" + }, "callToAction": { "title": "Call to Action组件" }, - "content": { - "title": "Content组件" + "footer": { + "title": "Footer组件" + }, + "pricing": { + "title": "Pricing组件" + }, + "comparator": { + "title": "Comparator组件" + }, + "faqs": { + "title": "FAQs组件" + }, + "login": { + "title": "Login组件" + }, + "signup": { + "title": "Signup组件" + }, + "contact": { + "title": "Contact组件" } } } diff --git a/next.config.ts b/next.config.ts index 3b62eef..f66e975 100644 --- a/next.config.ts +++ b/next.config.ts @@ -7,6 +7,7 @@ import { withContentCollections } from "@content-collections/next"; */ const nextConfig: NextConfig = { /* config options here */ + devIndicators: false, // https://nextjs.org/docs/architecture/nextjs-compiler#remove-console // Remove all console.* calls in production only diff --git a/src/app/[locale]/(blocks)/blocks/[category]/layout.tsx b/src/app/[locale]/(blocks)/blocks/[category]/layout.tsx deleted file mode 100644 index 22e56ea..0000000 --- a/src/app/[locale]/(blocks)/blocks/[category]/layout.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import CategoryNavigation from '@/components/blocks/blocks-nav'; -import { categories } from '@/components/blocks/blocks'; - -export default function CategoryLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { - return ( - <> - - {children} - > - ); -} diff --git a/src/app/[locale]/(blocks)/blocks/[category]/page.tsx b/src/app/[locale]/(blocks)/blocks/[category]/page.tsx deleted file mode 100644 index ab50279..0000000 --- a/src/app/[locale]/(blocks)/blocks/[category]/page.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import BlockPreview from '@/components/blocks/block-preview'; -import { blocks, categories } from '@/components/blocks/blocks'; -import { notFound } from 'next/navigation'; - -interface PageProps { - params: Promise<{ category: string }>; -} - -export const dynamic = 'force-static'; -export const revalidate = 3600; - -export async function generateStaticParams() { - return categories.map((category) => ({ - category: category, - })); -} - -export async function generateMetadata({ params }: PageProps) { - const { category } = await params; - return { - title: `Shadcn ${category} Blocks`, - }; -} - -export default async function CategoryPage({ params }: PageProps) { - const { category } = await params; - const categoryBlocks = blocks.filter((b) => b.category === category); - - if (categoryBlocks.length === 0) { - notFound(); - } - - return ( - <> - - - Shadcn {category} blocks - - - Speed up your workflow with responsive, pre-built UI blocks designed - for marketing websites. - - - - - {categoryBlocks.map((block, index) => ( - - ))} - > - ); -} diff --git a/src/app/[locale]/(marketing)/blocks/[category]/layout.tsx b/src/app/[locale]/(marketing)/blocks/[category]/layout.tsx new file mode 100644 index 0000000..43123b0 --- /dev/null +++ b/src/app/[locale]/(marketing)/blocks/[category]/layout.tsx @@ -0,0 +1,12 @@ +import { categories } from '@/components/blocks/blocks'; +import BlocksNav from '@/components/blocks/blocks-nav'; +import { PropsWithChildren } from 'react'; + +export default function CategoryLayout({ children }: PropsWithChildren) { + return ( + <> + + {children} + > + ); +} diff --git a/src/app/[locale]/(marketing)/blocks/[category]/page.tsx b/src/app/[locale]/(marketing)/blocks/[category]/page.tsx new file mode 100644 index 0000000..cb505ef --- /dev/null +++ b/src/app/[locale]/(marketing)/blocks/[category]/page.tsx @@ -0,0 +1,54 @@ +import BlockPreview from '@/components/blocks/block-preview'; +import { blocks, categories } from '@/components/blocks/blocks'; +import { constructMetadata } from '@/lib/metadata'; +import { getBaseUrlWithLocale } from '@/lib/urls/get-base-url'; +import { Metadata } from 'next'; +import { Locale } from 'next-intl'; +import { getTranslations } from 'next-intl/server'; +import { notFound } from 'next/navigation'; + +interface BlockCategoryPageProps { + params: Promise<{ category: string }>; +} + +export const dynamic = 'force-static'; +export const revalidate = 3600; + +export async function generateStaticParams() { + return categories.map((category) => ({ + category: category, + })); +} + +export async function generateMetadata({ + params, +}: { + params: Promise<{ locale: Locale; category: string }>; +}): Promise { + const { locale, category } = await params; + const t = await getTranslations({ locale, namespace: 'Metadata' }); + return constructMetadata({ + title: category + ' | ' + t('title'), + description: t('description'), + canonicalUrl: `${getBaseUrlWithLocale(locale)}/blocks/${category}`, + }); +} + +export default async function BlockCategoryPage({ + params, +}: BlockCategoryPageProps) { + const { category } = await params; + const categoryBlocks = blocks.filter((b) => b.category === category); + + if (categoryBlocks.length === 0) { + notFound(); + } + + return ( + <> + {categoryBlocks.map((block, index) => ( + + ))} + > + ); +} diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index b03b8b9..54d0c37 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -6,9 +6,9 @@ import { notFound } from 'next/navigation'; import { ReactNode } from 'react'; import { Toaster } from 'sonner'; import { Providers } from './providers'; +import { TailwindIndicator } from '@/components/tailwind-indicator'; import '@/styles/globals.css'; -import { TailwindIndicator } from '@/components/tailwind-indicator'; interface LocaleLayoutProps { children: ReactNode; @@ -52,7 +52,7 @@ export default async function LocaleLayout({ - + {/* */}
- Speed up your workflow with responsive, pre-built UI blocks designed - for marketing websites. -