|
| 1 | +import Container from "@/components/container" |
| 2 | +import MoreStories from "@/components/more-stories" |
| 3 | +import HeroPost from "@/components/hero-post" |
| 4 | +import Intro from "@/components/intro" |
| 5 | +import Layout from "@/components/layout" |
| 6 | +import { getAllPosts } from "@/lib/api" |
| 7 | +import { CMS_NAME } from "@/lib/constants" |
| 8 | +import Post from "@/types/post" |
| 9 | +import GettingStarted from "@/components/getting-started" |
| 10 | +import BuiltInUis from "@/components/builtin-uis" |
| 11 | +import type { Metadata } from 'next' |
| 12 | + |
| 13 | +export const metadata: Metadata = { |
| 14 | + title: `Next.js Example with ${CMS_NAME}`, |
| 15 | +} |
| 16 | + |
| 17 | +export default function Index() { |
| 18 | + const allPosts = getAllPosts([ |
| 19 | + 'title', |
| 20 | + 'date', |
| 21 | + 'slug', |
| 22 | + 'author', |
| 23 | + 'coverImage', |
| 24 | + 'excerpt', |
| 25 | + ]) as unknown as Post[] |
| 26 | + |
| 27 | + const heroPost = allPosts[0] |
| 28 | + const morePosts = allPosts.slice(1) |
| 29 | + |
| 30 | + return ( |
| 31 | + <Layout> |
| 32 | + <Container> |
| 33 | + <Intro /> |
| 34 | + <div className="mb-32 flex justify-center"> |
| 35 | + <GettingStarted template="nextjs" /> |
| 36 | + </div> |
| 37 | + |
| 38 | + |
| 39 | + <div className="flex justify-center my-20 py-20 bg-slate-100 dark:bg-slate-800"> |
| 40 | + <div className="text-center"> |
| 41 | + <svg className="text-link-dark w-36 h-36 inline-block" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="m8.58 17.25l.92-3.89l-3-2.58l3.95-.37L12 6.8l1.55 3.65l3.95.33l-3 2.58l.92 3.89L12 15.19zM12 2a10 10 0 0 1 10 10a10 10 0 0 1-10 10A10 10 0 0 1 2 12A10 10 0 0 1 12 2m0 2a8 8 0 0 0-8 8a8 8 0 0 0 8 8a8 8 0 0 0 8-8a8 8 0 0 0-8-8"/></svg> |
| 42 | + <h1 className="text-6xl md:text-7xl lg:text-8xl font-bold tracking-tighter leading-tight md:leading-none mb-12 text-center md:text-left"> |
| 43 | + Built-in UIs |
| 44 | + </h1> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + |
| 48 | + <div className="mb-40"> |
| 49 | + <p className="mt-4 mb-10 text-xl text-gray-600 dark:text-gray-400"> |
| 50 | + Manage your ServiceStack App and explore, discover, query and call APIs instantly with |
| 51 | + built-in Auto UIs dynamically generated from the rich metadata of your App's typed C# APIs & DTOs |
| 52 | + </p> |
| 53 | + |
| 54 | + <BuiltInUis /> |
| 55 | + </div> |
| 56 | + |
| 57 | + {heroPost && ( |
| 58 | + <HeroPost |
| 59 | + title={heroPost.title} |
| 60 | + coverImage={heroPost.coverImage} |
| 61 | + date={heroPost.date} |
| 62 | + author={heroPost.author} |
| 63 | + slug={heroPost.slug} |
| 64 | + excerpt={heroPost.excerpt} |
| 65 | + /> |
| 66 | + )} |
| 67 | + {morePosts.length > 0 && <MoreStories posts={morePosts} />} |
| 68 | + </Container> |
| 69 | + </Layout> |
| 70 | + ) |
| 71 | +} |
0 commit comments