Fix relay sitemap after the /r/... switch

This commit is contained in:
Daniele Tonon
2023-07-31 16:37:41 +02:00
parent 3b2fae5e5d
commit 903bcc1712
3 changed files with 3 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ func renderRelayPage(w http.ResponseWriter, r *http.Request) {
hostname := code[2:]
typ := "relay"
if strings.HasSuffix(hostname, ".xml") {
hostname = code[:len(hostname)-4]
hostname = hostname[:len(hostname)-4]
typ = "relay_sitemap"
}

View File

@@ -16,7 +16,7 @@
{{end}}
<meta property="twitter:card" content="summary" />
<link rel="sitemap" type="application/xml" title="Sitemap for {{.hostname | escapeString}}" href="/{{.hostname | escapeString}}.xml">
<link rel="sitemap" type="application/xml" title="Sitemap for {{.hostname | escapeString}}" href="/r/{{.hostname | escapeString}}.xml">
{{template "head_common.html" }}
</head>

View File

@@ -2,7 +2,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
{{if .npub}}<loc>https://nostr.com/{{.npub | escapeString}}</loc>{{end}}
{{if .hostname}}<loc>https://nostr.com/{{.hostname | escapeString}}</loc>{{end}}
{{if .hostname}}<loc>https://nostr.com/r/{{.hostname | escapeString}}</loc>{{end}}
<lastmod>{{.modifiedAt | escapeString}}</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>