diff --git a/routes.go b/routes.go index 81f129a..d471c28 100644 --- a/routes.go +++ b/routes.go @@ -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 { diff --git a/static/text/robots.txt b/static/text/robots.txt index 1f53798..e0c6441 100644 --- a/static/text/robots.txt +++ b/static/text/robots.txt @@ -1,2 +1,4 @@ User-agent: * Disallow: / +Allow: /Help/view +Allow: /sitemap.xml diff --git a/static/text/sitemap.xml b/static/text/sitemap.xml new file mode 100755 index 0000000..726c9c7 --- /dev/null +++ b/static/text/sitemap.xml @@ -0,0 +1,9 @@ + + + + https://awwkoala.com/Help/view + 2016-03-18 + monthly + 1.0 + + diff --git a/templates/view.tmpl b/templates/view.tmpl index b2b3fa9..cff34a0 100644 --- a/templates/view.tmpl +++ b/templates/view.tmpl @@ -34,7 +34,7 @@ a.deleteable {