File tree Expand file tree Collapse file tree
src/components/blogCarousel Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import React from "react" ;
33import Link from "@docusaurus/Link" ;
44import { getAuthorProfiles } from "../../utils/authors" ;
5- import { usePluginData } from "@docusaurus/useGlobalData" ;
5+
66
77interface BlogCardProps {
88 type : string ;
99 date ?: string ;
1010 title : string ;
11- content : string ;
1211 imageUrl : string ;
1312 id : string ;
1413 authors ?: string [ ] ;
@@ -50,7 +49,6 @@ const BlogCard = ({
5049 type,
5150 date,
5251 title,
53- content,
5452 imageUrl,
5553 id,
5654 authors,
@@ -80,7 +78,9 @@ const BlogCard = ({
8078 < div className = "article-card" >
8179 { /* Image */ }
8280 < div className = "card-image" >
83- < img src = { imageUrl } alt = { title } loading = "lazy" />
81+ < Link to = { `/blog/${ id } ` } className = "block" aria-label = { `Read ${ title } ` } >
82+ < img src = { imageUrl } alt = { title } loading = "lazy" />
83+ </ Link >
8484 </ div >
8585
8686 { /* Content */ }
@@ -202,4 +202,4 @@ const BlogCard = ({
202202 ) ;
203203} ;
204204
205- export default BlogCard ;
205+ export default BlogCard ;
Original file line number Diff line number Diff line change 102102 flex-shrink : 0 ;
103103}
104104
105+ .card-image a {
106+ display : block;
107+ width : 100% ;
108+ height : 100% ;
109+ }
110+
105111.card-image ::after {
106112 content : "" ;
107113 position : absolute;
112118 opacity : 0 ;
113119 transition : opacity 0.35s ease;
114120 z-index : 1 ;
121+ pointer-events : none;
115122}
116123
117124.article-card : hover .card-image ::after {
118125 opacity : 1 ;
119126}
120127
121128.card-image img {
129+ display : block;
122130 width : 100% ;
123131 height : 100% ;
124132 object-fit : cover;
157165 transition : color 0.2s ease;
158166 display : -webkit-box;
159167 -webkit-line-clamp : 2 ;
168+ line-clamp : 2 ;
160169 -webkit-box-orient : vertical;
161170 overflow : hidden;
162171}
195204 margin : 0 0 16px 0 ;
196205 display : -webkit-box;
197206 -webkit-line-clamp : 3 ;
207+ line-clamp : 3 ;
198208 -webkit-box-orient : vertical;
199209 overflow : hidden;
200210 flex : 1 ;
635645 transform : translateY (-20px );
636646 transition : opacity 0.4s ease-in, transform 0.4s ease-in;
637647}
648+
638649/* ── Reading time ── */
639650.card-reading-time {
640651 display : inline-flex;
You can’t perform that action at this time.
0 commit comments