diff --git a/src/components/Testimonials.astro b/src/components/Testimonials.astro index d3a06c6b..9275b80b 100644 --- a/src/components/Testimonials.astro +++ b/src/components/Testimonials.astro @@ -4,6 +4,7 @@ import _ from "lodash"; interface Props { names: string[]; + title?: string; } const defaultNames = [ @@ -26,6 +27,7 @@ const defaultNames = [ 'anonymous', ]; +const { title } = Astro.props as Props; const names = _(Astro.props.names || defaultNames); const testimonials = await getCollection('testimonial', ({ id }) => names.includes(id)); @@ -36,7 +38,7 @@ const sortedTestimonials = _(names) --- {testimonials && ( -

What others have said

+

{title ?? 'What others have said'}

{_(sortedTestimonials).map(({ data: { image, name, tagline, text, url } }) => ( diff --git a/src/pages/daily.mdx b/src/pages/daily.mdx index a3495625..a1ddcf76 100644 --- a/src/pages/daily.mdx +++ b/src/pages/daily.mdx @@ -25,7 +25,7 @@ import Testimonials from "~/components/Testimonials.astro";
- +
diff --git a/src/pages/testimonials.mdx b/src/pages/testimonials.mdx index fbdc7cdc..1e957c16 100644 --- a/src/pages/testimonials.mdx +++ b/src/pages/testimonials.mdx @@ -5,4 +5,4 @@ title: Testimonials import Testimonials from "~/components/Testimonials.astro"; - +