Add social links to homepage
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Neeldhara Misra 2026-06-14 01:51:54 +02:00
parent a15a35b4ce
commit 02e47cf5d0

View file

@ -38,6 +38,45 @@ const blogs = [
}, },
]; ];
const socialLinks = [
{
href: "https://x.com/home",
label: "X",
color: "#525252",
svg: `<path d="M5 5l14 14"></path><path d="M19 5L5 19"></path>`,
},
{
href: "https://bsky.app/profile/neeldhara.bsky.social",
label: "Bluesky",
color: "#4f83b8",
svg: `<path d="M12 13c-2.9-5.2-6-7.2-8.1-6.4-1.6.7-1 4.4 2.3 7.1"></path><path d="M12 13c2.9-5.2 6-7.2 8.1-6.4 1.6.7 1 4.4-2.3 7.1"></path><path d="M12 13c-2.3 1.6-3.6 3.1-3.3 4.6.3 1.4 2.1 1.8 3.3.2"></path><path d="M12 13c2.3 1.6 3.6 3.1 3.3 4.6-.3 1.4-2.1 1.8-3.3.2"></path>`,
},
{
href: "https://www.linkedin.com/in/neeldhara-misra-a54b6920/",
label: "LinkedIn",
color: "#496f9e",
svg: `<rect x="4.5" y="4.5" width="15" height="15" rx="2.5"></rect><path d="M8 10.5v5.5"></path><path d="M11.5 16v-5.5"></path><path d="M11.5 13.1c0-1.7 1-2.7 2.3-2.7 1.5 0 2.2 1 2.2 2.7V16"></path><path d="M8 8h.01"></path>`,
},
{
href: "https://mathstodon.xyz/@neeldhara",
label: "Mastodon",
color: "#7464a8",
svg: `<path d="M7 16.5c1.4.8 3.1 1.1 5.2 1 3.7-.1 5.8-1.7 6.1-4.8l.2-3.6c.2-3.1-1.4-4.7-4.5-4.7h-4c-3.1 0-4.7 1.6-4.5 4.7l.3 5.1c.2 3.4 2.2 5.2 5.9 5.3"></path><path d="M8.5 13V9.6c0-1.1.7-1.8 1.7-1.8.8 0 1.4.4 1.8 1.1.4-.7 1-1.1 1.8-1.1 1 0 1.7.7 1.7 1.8V13"></path><path d="M12 9.4V13"></path>`,
},
{
href: "https://www.youtube.com/@neeldhara",
label: "YouTube",
color: "#b55252",
svg: `<path d="M4.8 8.5c.2-1.2 1.1-2.1 2.3-2.2 1.6-.2 3.2-.3 4.9-.3s3.3.1 4.9.3c1.2.1 2.1 1 2.3 2.2.2 1.1.3 2.2.3 3.5s-.1 2.4-.3 3.5c-.2 1.2-1.1 2.1-2.3 2.2-1.6.2-3.2.3-4.9.3s-3.3-.1-4.9-.3c-1.2-.1-2.1-1-2.3-2.2-.2-1.1-.3-2.2-.3-3.5s.1-2.4.3-3.5Z"></path><path d="M10.5 9.5l4 2.5-4 2.5v-5Z"></path>`,
},
{
href: "https://www.instagram.com/neeldharamisra",
label: "Instagram",
color: "#9a6b8c",
svg: `<rect x="5" y="5" width="14" height="14" rx="4"></rect><circle cx="12" cy="12" r="3.2"></circle><path d="M16.3 7.8h.01"></path>`,
},
];
const rssHostSuffix = process.env.RSS_HOST_SUFFIX ?? "neeldhara.email"; const rssHostSuffix = process.env.RSS_HOST_SUFFIX ?? "neeldhara.email";
const publicHostSuffix = process.env.PUBLIC_HOST_SUFFIX ?? "neeldhara.blog"; const publicHostSuffix = process.env.PUBLIC_HOST_SUFFIX ?? "neeldhara.blog";
const outDir = new URL("../dist/", import.meta.url); const outDir = new URL("../dist/", import.meta.url);
@ -129,6 +168,14 @@ function renderSiteIcon(blog) {
</a>`; </a>`;
} }
function renderSocialLinks() {
return `<nav class="social-links" aria-label="Social links">
${socialLinks.map((link) => `<a class="social-link" href="${escapeHtml(link.href)}" aria-label="${escapeHtml(link.label)}" style="--social-color:${escapeHtml(link.color)}" target="_blank" rel="me noopener noreferrer">
<svg viewBox="0 0 24 24" aria-hidden="true">${link.svg}</svg>
</a>`).join("\n ")}
</nav>`;
}
function renderBlog(blog, posts) { function renderBlog(blog, posts) {
return `<details class="blog"> return `<details class="blog">
<summary> <summary>
@ -247,6 +294,40 @@ const html = `<!doctype html>
color: #666; color: #666;
font-weight: 500; font-weight: 500;
} }
.identity {
display: grid;
gap: 7px;
}
.social-links {
display: flex;
align-items: center;
gap: 13px;
margin-top: 7px;
}
.social-link {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
color: #222;
opacity: 0.72;
transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}
.social-link:hover {
color: var(--social-color);
opacity: 1;
transform: translateY(-1px);
}
.social-link svg {
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 1.7;
stroke-linecap: round;
stroke-linejoin: round;
}
.blog-list { .blog-list {
display: grid; display: grid;
gap: 28px; gap: 28px;
@ -365,9 +446,10 @@ const html = `<!doctype html>
</div> </div>
</section> </section>
<aside class="right" aria-label="About"> <aside class="right" aria-label="About">
<div> <div class="identity">
<h2>Neeldhara Misra</h2> <h2>Neeldhara Misra</h2>
<p class="role">Computer Science and Engineering, IIT Gandhinagar</p> <p class="role">Computer Science and Engineering, IIT Gandhinagar</p>
${renderSocialLinks()}
</div> </div>
<div class="bio"> <div class="bio">
<p>I am a computer science faculty member at IIT Gandhinagar. My academic work is broadly around algorithms, structural graph theory, parameterized complexity, computational social choice, combinatorial games, and fair allocation.</p> <p>I am a computer science faculty member at IIT Gandhinagar. My academic work is broadly around algorithms, structural graph theory, parameterized complexity, computational social choice, combinatorial games, and fair allocation.</p>