Compare commits

..

2 Commits

Author SHA1 Message Date
cd335a366e
Add XML namespace definition, fix wrong closing tag
Some checks failed
CI / Test and lint (push) Has been cancelled
2025-06-03 11:30:40 +04:00
b307d4de03
Generate profile image for feeds if missing 2025-06-03 11:23:46 +04:00
2 changed files with 4 additions and 2 deletions

View File

@ -34,7 +34,7 @@ export async function profileAtomFeed(
return `
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:nostr="urn:nostr:protocol">
<title>${profile.name} on Nostr (Articles)</title>
<link rel="alternate" type="text/html" href="${profile.profileUrl}" />
<link rel="alternate" type="application/nostr+json" href="nostr:${profile.npub}" />
@ -44,7 +44,7 @@ export async function profileAtomFeed(
<author>
<name>${profile.name}</name>
<uri>${profile.profileUrl}</uri>
<nostr:uri>nostr:${profile.nprofile}</nostr>
<nostr:uri>nostr:${profile.nprofile}</nostr:uri>
</author>
${articlesXml}
</feed>

View File

@ -4,6 +4,7 @@ import { fetchArticlesByAuthor, fetchProfileEvent } from "../nostr.ts";
import { profileAtomFeed } from "../feeds.ts";
import Profile from "../models/profile.ts";
import { notFoundHandler } from "../handlers/errors.ts";
import { generateOgProfileImage } from "../magick.ts";
const userAtomFeedHandler = async function (ctx: Context) {
const username = ctx.state.username;
@ -20,6 +21,7 @@ const userAtomFeedHandler = async function (ctx: Context) {
const profile = new Profile(profileEvent, username);
if (profile.nip05) {
await generateOgProfileImage(profile);
const articles = await fetchArticlesByAuthor(pubkey, 10);
const atom = await profileAtomFeed(profile, articles);