diff --git a/src/components/training-cta.js b/src/components/training-cta.js new file mode 100644 index 0000000..a2b00a0 --- /dev/null +++ b/src/components/training-cta.js @@ -0,0 +1,74 @@ +import * as React from "react" +import { useStaticQuery, graphql } from "gatsby" +import { Container, Grid } from "./ui/grid" +import CardPost from "./ui/card-post" +import Button from "./ui/button" + +const TrainingCta = () => { + const { allMdx } = useStaticQuery(graphql` + query { + allMdx( + filter: { fileAbsolutePath: { regex: "/(content/trainings)/" } } + sort: { order: ASC, fields: frontmatter___title } + ) { + nodes { + frontmatter { + title + site + thumbnail { + childImageSharp { + gatsbyImageData( + width: 400 + placeholder: BLURRED + formats: [AUTO, WEBP, AVIF] + ) + } + } + } + } + } + } + `) + + // One teaser per provider so the homepage stays vendor-neutral. + const hosts = new Set() + const teasers = allMdx.nodes + .map(n => n.frontmatter) + .filter(f => { + const host = new URL(f.site).hostname + return !hosts.has(host) && hosts.add(host) + }) + .slice(0, 3) + + return ( + +

+ Training & Certification +

+

+ Learn GitOps from the community: get certified as a GitOps Associate, + or pick from {allMdx.nodes.length} courses covering fundamentals, + Argo CD and GitOps at scale. +

+ + + {teasers.map(t => ( + + ))} + + +