mirror of
https://github.com/aljazceru/njump.git
synced 2025-12-17 06:14:22 +01:00
make robots.txt rendering a simple string thing.
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func renderRobots(w http.ResponseWriter, r *http.Request) {
|
||||
typ := "robots"
|
||||
w.Header().Set("Cache-Control", "max-age=3600")
|
||||
fmt.Fprintf(w, `User-agent: *
|
||||
Allow: /
|
||||
|
||||
params := map[string]any{}
|
||||
|
||||
if err := tmpls.ExecuteTemplate(w, templateMapping[typ], params); err != nil {
|
||||
log.Error().Err(err).Msg("error rendering")
|
||||
return
|
||||
}
|
||||
Sitemap: https://{{%s}}/npubs-archive.xml
|
||||
Sitemap: https://{{%s}}/relays-archive.xml
|
||||
`, s.CanonicalHost, s.CanonicalHost)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user