mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Improved robots, added sitemap. Locking is simpler now and allows direct click to edit.
This commit is contained in:
@@ -150,7 +150,11 @@ func editNote(c *gin.Context) {
|
||||
if title == "ws" {
|
||||
wshandler(c.Writer, c.Request)
|
||||
} else if title == "robots.txt" {
|
||||
c.Data(200, "text/plain", []byte(robotsTxt))
|
||||
robotsTxtFile, _ := ioutil.ReadFile(path.Join(RuntimeArgs.SourcePath, "static/text/robots.txt"))
|
||||
c.Data(200, "text/plain", robotsTxtFile)
|
||||
} else if title == "sitemap.xml" {
|
||||
robotsTxtFile, _ := ioutil.ReadFile(path.Join(RuntimeArgs.SourcePath, "static/text/sitemap.xml"))
|
||||
c.Data(200, "text/plain", robotsTxtFile)
|
||||
} else if strings.ToLower(title) == "help" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true {
|
||||
c.Redirect(302, "/Help/view")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user