AI Resource Pro / website · airesourcepro.com / src / app / videos / page.tsx
| 1 | import Link from "next/link"; |
| 2 | import { OwnedVideo } from "@/components/mdx/mdx-components"; |
| 3 | import { PageIntro } from "@/components/page-intro"; |
| 4 | import { TutorialMetaLine } from "@/components/tutorial-card"; |
| 5 | import { pageMetadata } from "@/lib/seo"; |
| 6 | import { getVideoTutorials } from "@/lib/tutorials"; |
| 7 | |
| 8 | // Kept out of search results (and the sitemap) until the first video is up, so Google doesn't index an empty page |
| 9 | export function generateMetadata() { |
| 10 | return pageMetadata({ |
| 11 | title: "AI video tutorials", |
| 12 | description: "Full video walkthroughs of the AI Resource Pro tutorials, played right here.", |
| 13 | path: "/videos", |
| 14 | noindex: getVideoTutorials().length === 0, |
| 15 | }); |
| 16 | } |
| 17 | |
| 18 | export default function VideosPage() { |
| 19 | const videos = getVideoTutorials(); |
| 20 | |
| 21 | return ( |
| 22 | <div className="page"> |
| 23 | <PageIntro label="Video" title="Videos" lead="Full walkthroughs of the tutorials." /> |
| 24 | |
| 25 | {videos.length === 0 ? ( |
| 26 | <p className="mt-16 border-t border-border pt-8 text-[var(--mist)]"> |
| 27 | The first videos are being recorded. |
| 28 | </p> |
| 29 | ) : ( |
| 30 | <div className="mt-16 grid gap-12 md:grid-cols-2"> |
| 31 | {videos.map((v) => ( |
| 32 | <div key={`${v.track}/${v.slug}`}> |
| 33 | <OwnedVideo id={v.video!} title={v.title} captions={v.videoCaptions} /> |
| 34 | <TutorialMetaLine tutorial={v} /> |
| 35 | <Link |
| 36 | href={`/${v.track}/${v.slug}`} |
| 37 | className="mt-3 block font-display text-2xl tracking-[-0.03em] transition-colors hover:text-primary" |
| 38 | > |
| 39 | {v.title} |
| 40 | </Link> |
| 41 | </div> |
| 42 | ))} |
| 43 | </div> |
| 44 | )} |
| 45 | </div> |
| 46 | ); |
| 47 | } |