mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 14:24:27 +01:00
rename variable CanonicalHost to Domain.
This commit is contained in:
4
main.go
4
main.go
@@ -17,7 +17,7 @@ import (
|
||||
type Settings struct {
|
||||
Port string `envconfig:"PORT" default:"2999"`
|
||||
DiskCachePath string `envconfig:"DISK_CACHE_PATH" default:"/tmp/njump-cache"`
|
||||
CanonicalHost string `envconfig:"DOMAIN" default:"njump.me"`
|
||||
Domain string `envconfig:"DOMAIN" default:"njump.me"`
|
||||
}
|
||||
|
||||
//go:embed static/*
|
||||
@@ -56,7 +56,7 @@ func main() {
|
||||
return
|
||||
} else {
|
||||
if canonicalHost := os.Getenv("CANONICAL_HOST"); canonicalHost != "" {
|
||||
s.CanonicalHost = canonicalHost
|
||||
s.Domain = canonicalHost
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,5 +12,5 @@ Allow: /
|
||||
|
||||
Sitemap: https://{{%s}}/npubs-archive.xml
|
||||
Sitemap: https://{{%s}}/relays-archive.xml
|
||||
`, s.CanonicalHost, s.CanonicalHost)
|
||||
`, s.Domain, s.Domain)
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
(yet) working.
|
||||
</p>
|
||||
<p>
|
||||
<i>njump</i> currently lives under {{ s.CanonicalHost }}, you can
|
||||
<i>njump</i> currently lives under {{ s.Domain }}, you can
|
||||
reach it appending a Nostr
|
||||
<a href="https://github.com/nostr-protocol/nips/blob/master/19.md"
|
||||
>NIP-19</a
|
||||
@@ -34,7 +34,7 @@
|
||||
entity (<code>npub</code>, <code>nevent</code>, <code>naddr</code>,
|
||||
etc) after the domain:
|
||||
<span class="exampleUrl"
|
||||
>{{ s.CanonicalHost }}/<nip-19-entity></span
|
||||
>{{ s.Domain }}/<nip-19-entity></span
|
||||
>.
|
||||
</p>
|
||||
<p>
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="try">
|
||||
<form action="/try" method="POST">
|
||||
<div class="tryForm">
|
||||
<div>{{ s.CanonicalHost }}/</div>
|
||||
<div>{{ s.Domain }}/</div>
|
||||
<input
|
||||
id="nip19entity"
|
||||
name="nip19entity"
|
||||
@@ -141,11 +141,11 @@
|
||||
>NIP-05</a
|
||||
>
|
||||
inspired permalink:
|
||||
<span class="exampleUrl">{{ s.CanonicalHost }}/<nip-5></span>,
|
||||
<span class="exampleUrl">{{ s.Domain }}/<nip-5></span>,
|
||||
for example:
|
||||
<a href="/nvk.org">https://{{ s.CanonicalHost }}/nvk.org</a> or
|
||||
<a href="/nvk.org">https://{{ s.Domain }}/nvk.org</a> or
|
||||
<a href="/mike@mikedilger.com"
|
||||
>https://{{ s.CanonicalHost }}/mike@mikedilger.com</a
|
||||
>https://{{ s.Domain }}/mike@mikedilger.com</a
|
||||
>.
|
||||
</p>
|
||||
<p>
|
||||
@@ -168,10 +168,10 @@
|
||||
<p>
|
||||
You can have a view of the last content posted to a relay using
|
||||
<span class="exampleUrl"
|
||||
>{{ s.CanonicalHost }}/r/<relay-host></span
|
||||
>{{ s.Domain }}/r/<relay-host></span
|
||||
>, for example:
|
||||
<a href="/r/nostr.wine"
|
||||
>https://{{ s.CanonicalHost }}/r/nostr.wine</a
|
||||
>https://{{ s.Domain }}/r/nostr.wine</a
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<link
|
||||
rel="canonical"
|
||||
href="https://{{s.CanonicalHost}}/{{.npub | escapeString }}"
|
||||
href="https://{{s.Domain}}/{{.npub | escapeString }}"
|
||||
/>
|
||||
<link
|
||||
rel="sitemap"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<urlset xmlns="http://www.Sitemaps.Org/schemas/sitemap/0.9">
|
||||
{{if .Npub}}
|
||||
<url>
|
||||
<loc>https://{{s.CanonicalHost}}/{{.Npub | escapeString}}</loc>
|
||||
<loc>https://{{s.Domain}}/{{.Npub | escapeString}}</loc>
|
||||
<lastmod>{{.ModifiedAt | escapeString}}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
@@ -10,7 +10,7 @@
|
||||
{{end}}
|
||||
{{if .Hostname}}
|
||||
<url>
|
||||
<loc>https://{{s.CanonicalHost}}/r/{{.Hostname | escapeString}}</loc>
|
||||
<loc>https://{{s.Domain}}/r/{{.Hostname | escapeString}}</loc>
|
||||
<lastmod>{{.ModifiedAt | escapeString}}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
@@ -19,7 +19,7 @@
|
||||
{{if .LastNotes}}
|
||||
{{range .LastNotes}}
|
||||
<url>
|
||||
<loc>https://{{s.CanonicalHost}}/{{.Nevent | escapeString}}</loc>
|
||||
<loc>https://{{s.Domain}}/{{.Nevent | escapeString}}</loc>
|
||||
<lastmod>{{.ModifiedAt | escapeString}}</lastmod>
|
||||
<changefreq>never</changefreq>
|
||||
<priority>0.5</priority>
|
||||
@@ -29,7 +29,7 @@
|
||||
{{if .Data}}
|
||||
{{range $element := .Data }}
|
||||
<url>
|
||||
<loc>https://{{s.CanonicalHost}}/{{$.PathPrefix}}{{$element | trimProtocol | escapeString}}</loc>
|
||||
<loc>https://{{s.Domain}}/{{$.PathPrefix}}{{$element | trimProtocol | escapeString}}</loc>
|
||||
<lastmod>{{$.ModifiedAt | escapeString}}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.5</priority>
|
||||
|
||||
Reference in New Issue
Block a user