mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 19:54:29 +01:00
fix empty pubkey rendering as the first item in all sitemaps.
This commit is contained in:
@@ -43,13 +43,13 @@ func renderArchive(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
keys := cache.GetPaginatedKeys(prefix, page, 5000)
|
||||
data := []string{}
|
||||
for i := 0; i < len(keys); i++ {
|
||||
for _, key := range keys {
|
||||
switch area {
|
||||
case NPUBS_ARCHIVE:
|
||||
npub, _ := nip19.EncodePublicKey(keys[i][3:])
|
||||
npub, _ := nip19.EncodePublicKey(key[3:])
|
||||
data = append(data, npub)
|
||||
case RELAYS_ARCHIVE:
|
||||
data = append(data, trimProtocol(keys[i][3:]))
|
||||
data = append(data, trimProtocol(key[3:]))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
{{if not (eq "" .Metadata.Npub)}}
|
||||
{{if not (eq "" .Metadata.PubKey)}}
|
||||
<url>
|
||||
<loc>https://{{.Host}}/{{.Metadata.Npub}}</loc>
|
||||
<lastmod>{{.ModifiedAt}}</lastmod>
|
||||
|
||||
Reference in New Issue
Block a user