import { ARTICLES_KEY } from "./key.mjs"; // Where an article opens in umtool: `/articles/` for one of the article // store's (release 26), `/sites//` for a site's own page. Pure, so a // client component can link with it. export function articleHref(a: { site: string; id: string }): string { return a.site === ARTICLES_KEY ? `/articles/${a.id}` : `/sites/${a.site}/${a.id}`; } // The same from a notes target id, `/`. export function articleHrefOf(targetId: string): string { const [site, id] = targetId.split("/"); return articleHref({ site, id }); } export { ARTICLES_KEY };