This commit is contained in:
parent
fb5a3b8093
commit
58d8b661a8
1055 changed files with 116254 additions and 89 deletions
75
sites/puzzles/src/blog-sites.js
Normal file
75
sites/puzzles/src/blog-sites.js
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
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: "Poetry",
|
||||
description: "Failed attempts at organizing thoughts in verse.",
|
||||
url: "https://poetry.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();
|
||||
Loading…
Add table
Add a link
Reference in a new issue