diff --git a/routes.go b/routes.go index 782f392..8f14047 100644 --- a/routes.go +++ b/routes.go @@ -23,6 +23,8 @@ func editNote(c *gin.Context) { title := c.Param("title") if title == "ws" { wshandler(c.Writer, c.Request) + } else if title == "robots.txt" { + c.Data(200, "text/plain", []byte(robots_txt)) } else if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { c.Redirect(302, "/about/view") } else { diff --git a/utils.go b/utils.go index 4cadedc..f1f5b1c 100644 --- a/utils.go +++ b/utils.go @@ -11,6 +11,7 @@ import ( var animals []string var adjectives []string +var robots_txt string func init() { rand.Seed(time.Now().Unix()) @@ -35,6 +36,9 @@ Have fun. **Powered by Raspberry Pi and Go** ![Raspberry Pi](/static/img/raspberrypi.png) ![Go Mascot](/static/img/gomascot.png)` + robots_txt = `User-agent: * +Disallow: /` + } func randomAnimal() string {