This commit is contained in:
parent
49d5dba526
commit
2ced04c0cc
2 changed files with 18 additions and 13 deletions
|
|
@ -142,49 +142,49 @@
|
|||
"poetry": [
|
||||
{
|
||||
"title": "Winning",
|
||||
"link": "https://poetry.neeldhara.blog/poems/winning/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/winning/",
|
||||
"date": "2024-01-13",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"title": "Poetry",
|
||||
"link": "https://poetry.neeldhara.blog/poems/poetry/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/poetry/",
|
||||
"date": "2024-01-01",
|
||||
"featured": true
|
||||
},
|
||||
{
|
||||
"title": "Letting Go",
|
||||
"link": "https://poetry.neeldhara.blog/poems/letting-go/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/letting-go/",
|
||||
"date": "2023-05-11",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"title": "Dad",
|
||||
"link": "https://poetry.neeldhara.blog/poems/dad/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/dad/",
|
||||
"date": "2012-08-27",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"title": "Seek",
|
||||
"link": "https://poetry.neeldhara.blog/poems/seek/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/seek/",
|
||||
"date": "2007-04-03",
|
||||
"featured": false
|
||||
},
|
||||
{
|
||||
"title": "Bloom",
|
||||
"link": "https://poetry.neeldhara.blog/poems/bloom/",
|
||||
"link": "https://pieces.neeldhara.blog/poems/bloom/",
|
||||
"date": "2005-02-03",
|
||||
"featured": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,9 @@ const blogs = [
|
|||
},
|
||||
{
|
||||
slug: "poetry",
|
||||
label: "Poetry",
|
||||
summary: "Poems, tiny forms, and playful writing around mathematics, code, and ordinary life.",
|
||||
host: "pieces",
|
||||
label: "Pieces",
|
||||
summary: "Poems, short prose, and small experiments in language.",
|
||||
},
|
||||
{
|
||||
slug: "reviews",
|
||||
|
|
@ -186,6 +187,10 @@ function slugFromFile(filePath, contentDir) {
|
|||
return relative.replace(/\/index\.mdx?$/i, "").replace(/\.mdx?$/i, "");
|
||||
}
|
||||
|
||||
function publicSlug(blog) {
|
||||
return blog.host ?? blog.slug;
|
||||
}
|
||||
|
||||
async function getLocalPosts(blog) {
|
||||
const contentDir = fileURLToPath(
|
||||
new URL(`sites/${blog.slug}/src/content/${blog.slug}/`, allblogsRoot),
|
||||
|
|
@ -210,7 +215,7 @@ async function getLocalPosts(blog) {
|
|||
|
||||
posts.push({
|
||||
title: data.title,
|
||||
link: `https://${blog.slug}.${publicHostSuffix}/${slug}/`,
|
||||
link: `https://${publicSlug(blog)}.${publicHostSuffix}/${slug}/`,
|
||||
date: pubDate.toISOString().slice(0, 10),
|
||||
featured: data["main-feature"] === true || data.mainFeature === true,
|
||||
});
|
||||
|
|
@ -257,7 +262,7 @@ function renderFeaturedPost(post) {
|
|||
}
|
||||
|
||||
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">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
|
|
@ -269,7 +274,7 @@ function renderRssIcon(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">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue