flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 758676c26d0a87c9354a795aed370bc06b91be6b
parent a5fcd4b6cc4016d4f6d474891200a9e14bc6a53e
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon,  1 Feb 2021 21:52:23 -0800

Add robots.txt for proxy

Ban all crawlers

Diffstat:
Mproxy.go | 4++++
Atemplates/proxy-robots.txt | 2++
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/proxy.go b/proxy.go @@ -25,6 +25,10 @@ func proxyGemini(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { http.Redirect(w, r, "gemini.circumlunar.space", http.StatusSeeOther) return + } else if r.URL.Path == "/robots.txt" { + temp := c.TemplatesDirectory + http.ServeFile(w, r, path.Join(temp, "proxy-robots.txt")) + return } else { spath = strings.SplitN(r.URL.Path, "/", 3) } diff --git a/templates/proxy-robots.txt b/templates/proxy-robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /