Rename poetry links to pieces
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Neeldhara Misra 2026-06-25 16:20:49 +05:30
parent 49d5dba526
commit 2ced04c0cc
2 changed files with 18 additions and 13 deletions

View file

@ -142,49 +142,49 @@
"poetry": [ "poetry": [
{ {
"title": "Winning", "title": "Winning",
"link": "https://poetry.neeldhara.blog/poems/winning/", "link": "https://pieces.neeldhara.blog/poems/winning/",
"date": "2024-01-13", "date": "2024-01-13",
"featured": false "featured": false
}, },
{ {
"title": "Poetry", "title": "Poetry",
"link": "https://poetry.neeldhara.blog/poems/poetry/", "link": "https://pieces.neeldhara.blog/poems/poetry/",
"date": "2024-01-01", "date": "2024-01-01",
"featured": true "featured": true
}, },
{ {
"title": "Letting Go", "title": "Letting Go",
"link": "https://poetry.neeldhara.blog/poems/letting-go/", "link": "https://pieces.neeldhara.blog/poems/letting-go/",
"date": "2023-05-11", "date": "2023-05-11",
"featured": false "featured": false
}, },
{ {
"title": "Dad", "title": "Dad",
"link": "https://poetry.neeldhara.blog/poems/dad/", "link": "https://pieces.neeldhara.blog/poems/dad/",
"date": "2012-08-27", "date": "2012-08-27",
"featured": false "featured": false
}, },
{ {
"title": "On the Fence", "title": "On the Fence",
"link": "https://poetry.neeldhara.blog/poems/on-the-fence/", "link": "https://pieces.neeldhara.blog/poems/on-the-fence/",
"date": "2012-04-23", "date": "2012-04-23",
"featured": false "featured": false
}, },
{ {
"title": "Sprinkles of the Sky", "title": "Sprinkles of the Sky",
"link": "https://poetry.neeldhara.blog/poems/sprinkles-of-the-sky/", "link": "https://pieces.neeldhara.blog/poems/sprinkles-of-the-sky/",
"date": "2011-01-05", "date": "2011-01-05",
"featured": false "featured": false
}, },
{ {
"title": "Seek", "title": "Seek",
"link": "https://poetry.neeldhara.blog/poems/seek/", "link": "https://pieces.neeldhara.blog/poems/seek/",
"date": "2007-04-03", "date": "2007-04-03",
"featured": false "featured": false
}, },
{ {
"title": "Bloom", "title": "Bloom",
"link": "https://poetry.neeldhara.blog/poems/bloom/", "link": "https://pieces.neeldhara.blog/poems/bloom/",
"date": "2005-02-03", "date": "2005-02-03",
"featured": false "featured": false
} }

View file

@ -32,8 +32,9 @@ const blogs = [
}, },
{ {
slug: "poetry", slug: "poetry",
label: "Poetry", host: "pieces",
summary: "Poems, tiny forms, and playful writing around mathematics, code, and ordinary life.", label: "Pieces",
summary: "Poems, short prose, and small experiments in language.",
}, },
{ {
slug: "reviews", slug: "reviews",
@ -186,6 +187,10 @@ function slugFromFile(filePath, contentDir) {
return relative.replace(/\/index\.mdx?$/i, "").replace(/\.mdx?$/i, ""); return relative.replace(/\/index\.mdx?$/i, "").replace(/\.mdx?$/i, "");
} }
function publicSlug(blog) {
return blog.host ?? blog.slug;
}
async function getLocalPosts(blog) { async function getLocalPosts(blog) {
const contentDir = fileURLToPath( const contentDir = fileURLToPath(
new URL(`sites/${blog.slug}/src/content/${blog.slug}/`, allblogsRoot), new URL(`sites/${blog.slug}/src/content/${blog.slug}/`, allblogsRoot),
@ -210,7 +215,7 @@ async function getLocalPosts(blog) {
posts.push({ posts.push({
title: data.title, title: data.title,
link: `https://${blog.slug}.${publicHostSuffix}/${slug}/`, link: `https://${publicSlug(blog)}.${publicHostSuffix}/${slug}/`,
date: pubDate.toISOString().slice(0, 10), date: pubDate.toISOString().slice(0, 10),
featured: data["main-feature"] === true || data.mainFeature === true, featured: data["main-feature"] === true || data.mainFeature === true,
}); });
@ -257,7 +262,7 @@ function renderFeaturedPost(post) {
} }
function renderRssIcon(blog) { function renderRssIcon(blog) {
const href = `https://${blog.slug}.${publicHostSuffix}/rss.xml`; const href = `https://${publicSlug(blog)}.${publicHostSuffix}/rss.xml`;
return `<a class="icon-link" href="${escapeHtml(href)}" aria-label="${escapeHtml(blog.label)} RSS"> return `<a class="icon-link" href="${escapeHtml(href)}" aria-label="${escapeHtml(blog.label)} RSS">
<svg viewBox="0 0 24 24" aria-hidden="true"> <svg viewBox="0 0 24 24" aria-hidden="true">
@ -269,7 +274,7 @@ function renderRssIcon(blog) {
} }
function renderSiteIcon(blog) { function renderSiteIcon(blog) {
const href = `https://${blog.slug}.${publicHostSuffix}/`; const href = `https://${publicSlug(blog)}.${publicHostSuffix}/`;
return `<a class="icon-link" href="${escapeHtml(href)}" aria-label="${escapeHtml(blog.label)} site"> return `<a class="icon-link" href="${escapeHtml(href)}" aria-label="${escapeHtml(blog.label)} site">
<svg viewBox="0 0 24 24" aria-hidden="true"> <svg viewBox="0 0 24 24" aria-hidden="true">