`;
}
export function articleListHtml(articles: Article[]): string {
if (articles.length === 0) return "";
const sortedArticles = articles.sort((a, b) => b.publishedAt - a.publishedAt);
let html = "";
for (const article of sortedArticles) {
html += articleListItemHtml(article);
}
return `
Articles
${html}
`;
}
export function profilePageHtml(profile: Profile, articles: Article[]): string {
const title = `${profile.name} on Nostr`;
const body = `
${profile.name}
${profile.about}
Public key
${profile.npub}
${articleListHtml(articles)}
`;
return htmlLayout(title, body, profile);
}
function openWithNostrAppHtml(bech32Id): string {
let appLinksHtml = "";
const appLinks = [
{ title: "Habla", href: `https://habla.news/a/${bech32Id}` },
{
title: "noStrudel",
href: `https://nostrudel.ninja/#/articles/${bech32Id}`,
},
{ title: "Coracle", href: `https://coracle.social/${bech32Id}` },
];
for (const link of appLinks) {
appLinksHtml += `${link.title}`;
}
return `