blogs/sites/puzzles/src/blog-sites.js
Neeldhara Misra 164f4a0f3c
Some checks are pending
Build / build (push) Waiting to run
Rename poetry site to pieces
2026-06-25 16:19:48 +05:30

75 lines
1.9 KiB
JavaScript

export const BLOG_SITES = [
{
key: "research",
title: "Research",
description:
"Notes from papers I am reading, and mini-surveys of themes I'm learning about.",
url: "https://research.neeldhara.blog",
},
{
key: "vibes",
title: "Vibes",
description:
"Conversations with LLMs with an intent to create something meaningful.",
url: "https://vibes.neeldhara.blog",
},
{
key: "puzzles",
title: "Puzzles",
description:
"Problems, puzzles, contest editorials, and mathematical magic.",
url: "https://puzzles.neeldhara.blog",
},
{
key: "reflections",
title: "Reflections",
description: "Random musings, pseudo-advice, how-tos. Core dumped.",
url: "https://reflections.neeldhara.blog",
},
{
key: "poetry",
title: "Pieces",
description: "Poems, short prose, and small experiments in language.",
url: "https://pieces.neeldhara.blog",
},
{
key: "reviews",
title: "Reviews",
description:
"Reviews of things I use or consume: software, books, hardware, etc.",
url: "https://reviews.neeldhara.blog",
},
{
key: "art",
title: "Art",
description:
"This exists so I can stay accountable to my doodling practice :)",
url: "https://art.neeldhara.blog",
},
];
export const DEFAULT_BLOG_SITE_KEY = "puzzles";
export const BLOG_SITE_KEYS = BLOG_SITES.map((site) => site.key);
function getEnvironmentBlogSiteKey() {
if (typeof process === "undefined") {
return undefined;
}
return process.env?.BLOG_SITE;
}
export function getBlogSite(key = getEnvironmentBlogSiteKey()) {
const normalizedKey = key || DEFAULT_BLOG_SITE_KEY;
const site = BLOG_SITES.find((candidate) => candidate.key === normalizedKey);
if (!site) {
throw new Error(
`Unknown BLOG_SITE "${normalizedKey}". Expected one of: ${BLOG_SITE_KEYS.join(", ")}`,
);
}
return site;
}
export const ACTIVE_BLOG_SITE = getBlogSite();