@@ -26,6 +26,8 @@ type BaseProps = {
2626 currentSlug? : string
2727 /** Controls whether navigation wraps around */
2828 navigationMode? : CarouselNavigationMode
29+ /** Whether to show the "Read More" link */
30+ showReadMore: boolean
2931}
3032
3133export type Props =
@@ -42,14 +44,15 @@ export type Props =
4244 })
4345
4446const {
45- title = ' Featured Content ' ,
47+ title,
4648 titleHref,
4749 limit = 3 ,
4850 variant = ' featured' ,
4951 currentSlug,
5052 type,
5153 items : itemsOverride,
5254 navigationMode = ' wrap' ,
55+ showReadMore = false ,
5356} = Astro .props
5457
5558const allItems: ItemType [] = itemsOverride
@@ -73,17 +76,19 @@ const carouselId = `carousel-${type}-${variant}-${currentSlug ?? 'all'}`
7376 class = " block"
7477 >
7578 <section class = " max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8" >
76- <header class = " text-center mb-6" >
77- <h2 id = { ` ${carouselId }-title ` } class = " font-bold" >
78- { titleHref ? (
79- <a href = { titleHref } class = " hover:text-primary transition-colors duration-200 no-underline" >
80- { title }
81- </a >
82- ) : (
83- title
84- )}
85- </h2 >
86- </header >
79+ { title && (
80+ <header class = " text-center mb-6" >
81+ <h2 id = { ` ${carouselId }-title ` } class = " font-bold" >
82+ { titleHref ? (
83+ <a href = { titleHref } class = " hover:text-primary transition-colors duration-200 no-underline" >
84+ { title }
85+ </a >
86+ ) : (
87+ title
88+ )}
89+ </h2 >
90+ </header >
91+ )}
8792
8893 { /* Embla Carousel */ }
8994 <div class = " embla relative" role = " region" aria-labelledby = { ` ${carouselId }-title ` } >
@@ -196,12 +201,39 @@ const carouselId = `carousel-${type}-${variant}-${currentSlug ?? 'all'}`
196201 </button >
197202
198203 { /* Dots Navigation */ }
199- <div
200- class = " embla__dots flex gap-2 justify-center mt-8"
201- role = " group"
202- aria-label = { ` ${title } slide navigation ` }
203- data-carousel-pagination
204- />
204+ <div class = " mt-8 grid grid-cols-[1fr_auto_1fr] items-center" >
205+ <span aria-hidden = " true" />
206+ <span
207+ class = " embla__dots flex gap-2 justify-center"
208+ role = " group"
209+ aria-label = { ` ${title } slide navigation ` }
210+ data-carousel-pagination
211+ />
212+
213+ { showReadMore ? (
214+ <span class = " flex justify-end mr-4" >
215+ <a
216+ href = " /articles"
217+ class = " inline-flex items-center px-6 py-3 bg-content-active text-content-inverse font-semibold rounded-lg hover:bg-content no-underline hover:no-underline transition-all duration-200"
218+ >
219+ Read More Articles
220+ <svg
221+ class = " ml-2 w-4 h-4"
222+ fill = " none"
223+ stroke = " currentColor"
224+ viewBox = " 0 0 24 24"
225+ aria-hidden = " true"
226+ focusable = " false"
227+ >
228+ <path stroke-linecap = " round" stroke-linejoin = " round" stroke-width = " 2" d = " M9 5l7 7-7 7"
229+ ></path >
230+ </svg >
231+ </a >
232+ </span >
233+ ) : (
234+ <span aria-hidden = " true" />
235+ )}
236+ </div >
205237
206238 <p
207239 class = " sr-only"
0 commit comments