fix missing profile metadata in XML feeds

This commit is contained in:
Solomon Victorino
2024-03-03 16:03:46 -07:00
parent 8a8663a36a
commit 814fd2139c
3 changed files with 6 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ type SitemapPage struct {
ModifiedAt string
// for the profile sitemap
Npub string
Metadata Metadata
// for the relay sitemap
RelayHostname string
@@ -46,7 +46,6 @@ type RSSPage struct {
Title string
// for the profile RSS
Npub string
Metadata Metadata
// for the relay RSS

View File

@@ -1,13 +1,13 @@
<feed xmlns="http://www.w3.org/2005/Atom">
<updated>{{.ModifiedAt}}</updated>
<generator>https://{{.Host}}</generator>
{{if not (eq "" .Npub)}}
{{if not (eq "" .Metadata.Npub)}}
<title>Nostr notes by {{.Metadata.Name}}</title>
<author>
<name>{{.Metadata.Name}}</name>
</author>
<link href="https://{{.Host}}/{{.Npub}}" />
<id>{{.Npub}}</id>
<link href="https://{{.Host}}/{{.Metadata.Npub}}" />
<id>{{.Metadata.Npub}}</id>
<icon>{{.Metadata.Picture}}</icon>
<logo>{{.Metadata.Picture}}</logo>
{{end}}

View File

@@ -1,7 +1,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{if not (eq "" .Npub)}}
{{if not (eq "" .Metadata.Npub)}}
<url>
<loc>https://{{.Host}}/{{.Npub}}</loc>
<loc>https://{{.Host}}/{{.Metadata.Npub}}</loc>
<lastmod>{{.ModifiedAt}}</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>