Skip to content

Commit 0dbd2e4

Browse files
committed
fix: the social icons were not avaliable to of all writers now available fixing (#1127)
1 parent f3bf953 commit 0dbd2e4

8 files changed

Lines changed: 436 additions & 52 deletions

File tree

blog/authors.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ ajay-dhangar:
77
page: true # Turns the feature on
88
description: >
99
A passionate developer who loves to code and build new things. I am a Full Stack Developer and a Cyber Security, ML & AI Enthusiast. I am also a Technical Content Writer and a Speaker. I love to share my knowledge with the community. I am the Founder of CodeHarborHub. I am also a Technical Content Writer at GeeksforGeeks. I am a Girl Script Summer of Code 2024 Project Manager (PA).
10+
socials:
11+
x: https://x.com/CodesWithAjay
12+
linkedin: ajay-dhangar
13+
github: ajay-dhangar
14+
youtube: ajay-dhangar
15+
facebook: ajay.dhangar.2001
1016

1117
sanjay-kv:
1218
name: Sanjay Viswanthan
@@ -29,57 +35,79 @@ sanjay-kv:
2935

3036
hitesh-gahanolia:
3137
name: Hitesh Gahanolia
32-
tile: Final Year Student At MNNIT ALLAHABAD
38+
title: Final Year Student At MNNIT ALLAHABAD
3339
url: https://github.com/Hitesh4278
3440
image_url: https://avatars.githubusercontent.com/u/97452642?v=4
41+
socials:
42+
github: Hitesh4278
3543

3644
sowmiya-v:
3745
name: Sowmiya Venkatesan
38-
tile: Business Strategy & Operations Manager
46+
title: Business Strategy & Operations Manager
3947
url: https://github.com/sowmiyeh
4048
image_url: https://avatars.githubusercontent.com/u/74345706?v=4
49+
socials:
50+
x: sowmiyeh
51+
linkedin: sowmiyavenkatesan
52+
github: sowmiyeh
53+
# medium: sowmiyeh
54+
# hashnode: sowmiyeh
4155

4256
abhijith-m-s:
4357
name: Abhijith M S
4458
title: Full Stack Developer
4559
url: https://github.com/AMS003010
4660
image_url: https://avatars.githubusercontent.com/u/111883236?v=4
61+
socials:
62+
github: AMS003010
4763

4864
khushi-kalra:
4965
name: Khushi Kalra
5066
title: Full Stack Developer
5167
url: "https://github.com/abckhush"
5268
image_url: "https://yt3.googleusercontent.com/BpaBYEiGibr8uiNMCWytJ5BdKbPtpqTJAuA5Ida5rXAe8Zfvr8keZSPXYSqGasjGo7OunF2w=s176-c-k-c0x00ffffff-no-rj"
69+
socials:
70+
github: abckhush
5371

5472
nayanikamukherjee:
5573
name: Nayanika Mukherjee
5674
title: Full Stack Developer
5775
url: "https://github.com/Nayanika1402"
5876
image_url: https://avatars.githubusercontent.com/u/132455412?v=4
77+
socials:
78+
github: Nayanika1402
5979

6080
pujan-sarkar:
6181
name: Pujan Sarkar
6282
title: Cyber Security Enthusiast
6383
url: "https://github.com/Pujan-sarkar"
6484
image_url: https://avatars.githubusercontent.com/u/144250917?v=4
85+
socials:
86+
github: Pujan-sarkar
6587

6688
mohitmuktikant:
6789
name: Mohit Muktikant
6890
title: Full Stack Web Developer
6991
url: "https://github.com/mohitmuktikant"
7092
image_url: https://avatars.githubusercontent.com/u/101824646?v=4
93+
socials:
94+
github: mohitmuktikant
7195

7296
santhosh-siddhardha:
7397
name: Lingamuneni Santhosh Siddhardha
7498
title: Software Engineer
7599
url: "https://github.com/Santhosh-Siddhardha"
76100
image_url: https://avatars.githubusercontent.com/u/103999924?v=4
101+
socials:
102+
github: Santhosh-Siddhardha
77103

78104
akshitha-chiluka:
79105
name: Akshitha Chiluka
80106
title: Software Engineering Undergraduate
81107
url: https://github.com/AKSHITHA-CHILUKA
82108
image_url: https://avatars.githubusercontent.com/u/120377576?v=4
109+
socials:
110+
github: AKSHITHA-CHILUKA
83111

84112
Aditya-Singh-Rathore:
85113
name: Aditya Singh Rathore
@@ -96,4 +124,4 @@ Aditya-Singh-Rathore:
96124
github: Adez017
97125
instagram: _aaditya_.017
98126
bluesky: adez017.bsky.social
99-
x: https://x.com/Adez017
127+
x: Adez017

src/pages/blogs/blogs-new.css

Lines changed: 85 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,58 +1627,117 @@
16271627
width: 80px;
16281628
}
16291629

1630+
.card-authors-container {
1631+
display: flex;
1632+
flex-direction: column;
1633+
gap: 12px;
1634+
flex: 1;
1635+
min-width: 0;
1636+
}
1637+
16301638
.card-author {
16311639
display: flex;
16321640
align-items: center;
1633-
gap: 10px;
1634-
flex: 1;
1635-
min-width: 0; /* Allow text to shrink */
1641+
gap: 12px;
1642+
min-width: 0;
16361643
}
16371644

16381645
.author-avatar {
1639-
width: 32px;
1640-
height: 32px;
1646+
width: 40px;
1647+
height: 40px;
16411648
border-radius: 50%;
1642-
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
1649+
background: var(--ifm-color-emphasis-200);
16431650
display: flex;
16441651
align-items: center;
16451652
justify-content: center;
1646-
font-size: 16px;
1647-
color: white;
1648-
font-weight: 600;
1649-
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
1650-
flex-shrink: 0;
1653+
overflow: hidden;
1654+
border: 2px solid transparent;
16511655
transition: all 0.3s ease;
1656+
flex-shrink: 0;
16521657
}
16531658

1654-
.author-avatar:hover {
1655-
transform: scale(1.1);
1656-
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
1659+
.author-img {
1660+
width: 100%;
1661+
height: 100%;
1662+
object-fit: cover;
1663+
}
1664+
1665+
.author-info {
1666+
display: flex;
1667+
flex-direction: column;
1668+
gap: 2px;
1669+
min-width: 0;
16571670
}
16581671

16591672
.author-name {
1660-
font-size: 13px;
1661-
color: #475569;
1662-
font-weight: 600;
1673+
font-size: 14px;
1674+
color: #1e293b;
1675+
font-weight: 700;
16631676
white-space: nowrap;
16641677
overflow: hidden;
16651678
text-overflow: ellipsis;
1666-
max-width: 100%;
1667-
position: relative;
1668-
cursor: help;
16691679
transition: color 0.2s ease;
16701680
}
16711681

1672-
.author-name:hover {
1673-
color: #6366f1;
1682+
[data-theme="dark"] .author-name {
1683+
color: #f1f5f9;
16741684
}
16751685

1676-
[data-theme="dark"] .author-name {
1677-
color: #cbd5e1;
1686+
.author-social-links {
1687+
display: flex;
1688+
gap: 8px;
1689+
margin-top: 2px;
16781690
}
16791691

1680-
[data-theme="dark"] .author-name:hover {
1681-
color: #a78bfa;
1692+
.author-social-link {
1693+
display: flex;
1694+
align-items: center;
1695+
justify-content: center;
1696+
font-size: 14px;
1697+
color: #64748b;
1698+
transition: all 0.2s ease;
1699+
width: 24px;
1700+
height: 24px;
1701+
border-radius: 6px;
1702+
background: rgba(0, 0, 0, 0.03);
1703+
}
1704+
1705+
[data-theme="dark"] .author-social-link {
1706+
color: #94a3b8;
1707+
background: rgba(255, 255, 255, 0.05);
1708+
}
1709+
1710+
.author-social-link:hover {
1711+
transform: translateY(-2px);
1712+
text-decoration: none;
1713+
}
1714+
1715+
.author-social-link.github:hover {
1716+
color: #181717;
1717+
background: rgba(24, 23, 23, 0.1);
1718+
}
1719+
1720+
.author-social-link.linkedin:hover {
1721+
color: #0a66c2;
1722+
background: rgba(10, 102, 194, 0.1);
1723+
}
1724+
1725+
.author-social-link.x:hover {
1726+
color: #000000;
1727+
background: rgba(0, 0, 0, 0.1);
1728+
}
1729+
1730+
[data-theme="dark"] .author-social-link.github:hover {
1731+
color: #ffffff;
1732+
}
1733+
1734+
[data-theme="dark"] .author-social-link.x:hover {
1735+
color: #ffffff;
1736+
}
1737+
1738+
[data-theme="dark"] .author-social-link.linkedin:hover {
1739+
color: #0a66c2;
1740+
background: rgba(10, 102, 194, 0.2);
16821741
}
16831742

16841743
/* Tooltip for author names */

src/pages/blogs/index.tsx

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import Layout from "@theme/Layout";
44
import Link from "@docusaurus/Link";
55
import blogs from "../../database/blogs/index";
66
import Head from "@docusaurus/Head";
7+
import { FaGithub, FaLinkedin } from "react-icons/fa";
8+
import { FaXTwitter } from "react-icons/fa6";
9+
import { authorsMap } from "../../utils/authors";
710

811
import "./blogs-new.css";
912

@@ -269,12 +272,52 @@ export default function Blogs(): React.JSX.Element {
269272

270273
const BlogCard = ({ blog, index }) => {
271274
// Get authors for this blog post
272-
const getAuthors = (slug) => {
273-
const authors = authorMapping[slug] || ["recode hive Team"];
274-
return authors.length > 1 ? authors.join(" & ") : authors[0];
275+
const getAuthorsData = (slug: string) => {
276+
// Some blogs might have multiple authors
277+
const authorIds = blog.authors || [];
278+
return authorIds.map((id) => ({
279+
id,
280+
...authorsMap[id],
281+
}));
275282
};
276283

277-
const authorName = getAuthors(blog.slug);
284+
const authors = getAuthorsData(blog.slug);
285+
286+
const renderSocialIcons = (author) => {
287+
if (!author.socials) return null;
288+
289+
return (
290+
<div className="author-social-links">
291+
{author.socials.github && (
292+
<Link
293+
href={`https://github.com/${author.socials.github}`}
294+
className="author-social-link github"
295+
title="GitHub"
296+
>
297+
<FaGithub />
298+
</Link>
299+
)}
300+
{author.socials.linkedin && (
301+
<Link
302+
href={`https://www.linkedin.com/in/${author.socials.linkedin}`}
303+
className="author-social-link linkedin"
304+
title="LinkedIn"
305+
>
306+
<FaLinkedin />
307+
</Link>
308+
)}
309+
{author.socials.x && (
310+
<Link
311+
href={`https://x.com/${author.socials.x}`}
312+
className="author-social-link x"
313+
title="X"
314+
>
315+
<FaXTwitter />
316+
</Link>
317+
)}
318+
</div>
319+
);
320+
};
278321

279322
return (
280323
<div className="article-card">
@@ -286,11 +329,25 @@ const BlogCard = ({ blog, index }) => {
286329
<h3 className="card-title">{blog.title}</h3>
287330
<p className="card-description">{blog.description}</p>
288331
<div className="card-meta">
289-
<div className="card-author">
290-
<span className="author-avatar">👤</span>
291-
<span className="author-name" data-full-name={authorName}>
292-
{authorName}
293-
</span>
332+
<div className="card-authors-container">
333+
{authors.map((author, idx) => (
334+
<div key={author.id} className="card-author">
335+
<span className="author-avatar">
336+
<img
337+
src={author.id ? `https://github.com/${author.socials?.github || author.id}.png` : ""}
338+
alt={author.name}
339+
className="author-img"
340+
onError={(e) => {
341+
(e.target as HTMLImageElement).src = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E";
342+
}}
343+
/>
344+
</span>
345+
<div className="author-info">
346+
<span className="author-name">{author.name || "recode hive Team"}</span>
347+
{renderSocialIcons(author)}
348+
</div>
349+
</div>
350+
))}
294351
</div>
295352
<span className="card-read-time">5 min read</span>
296353
</div>

0 commit comments

Comments
 (0)