From ad5d841b5d3e4098317d31ae1f380df93cdd1042 Mon Sep 17 00:00:00 2001 From: M1kola Date: Sat, 11 Jan 2025 17:06:23 +0300 Subject: [PATCH] export static --- app/events/[slug]/page.tsx | 13 +++++++++++++ app/participants/[slug]/page.tsx | 13 +++++++++++++ components/event-card.tsx | 2 +- components/human-card.tsx | 2 +- next.config.ts | 2 +- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/events/[slug]/page.tsx b/app/events/[slug]/page.tsx index 5f2587a..3851cb9 100644 --- a/app/events/[slug]/page.tsx +++ b/app/events/[slug]/page.tsx @@ -5,6 +5,19 @@ import InfoItem from "@/components/info-item"; import HumanCard from "@/components/human-card"; import SocialItem from "@/components/social-item"; +export async function generateStaticParams() { + // Моканные данные мероприятий + const events = [ + { slug: 'event-1' }, + { slug: 'event-2' }, + { slug: 'event-3' }, + ]; + + return events.map(event => ({ + slug: event.slug, + })); +} + export default function Page() { const infoItems = [ { diff --git a/app/participants/[slug]/page.tsx b/app/participants/[slug]/page.tsx index efe3e0a..17e7981 100644 --- a/app/participants/[slug]/page.tsx +++ b/app/participants/[slug]/page.tsx @@ -5,6 +5,19 @@ import InfoItem from "@/components/info-item"; import Image from "next/image"; import SocialItem from "@/components/social-item"; +export async function generateStaticParams() { + // Моканные данные участников + const participants = [ + { slug: '1' }, + { slug: '2' }, + { slug: '3' }, + ]; + + return participants.map(participant => ({ + slug: participant.slug, + })); +} + export default function Page() { return(
diff --git a/components/event-card.tsx b/components/event-card.tsx index 4278f67..4c9a501 100644 --- a/components/event-card.tsx +++ b/components/event-card.tsx @@ -10,7 +10,7 @@ interface Props { const EventCard: React.FC = ({title, description, image}) => { return ( - + {image ? image : } diff --git a/components/human-card.tsx b/components/human-card.tsx index ebd47ac..235d2b0 100644 --- a/components/human-card.tsx +++ b/components/human-card.tsx @@ -41,7 +41,7 @@ const HumanCard: React.FC = ({name, description, image, skills,post, vari }; return ( - + {image ? image : image } diff --git a/next.config.ts b/next.config.ts index e9ffa30..8401901 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + output: 'export' }; export default nextConfig;