summaryrefslogtreecommitdiffci
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rw-r--r--internal/router/handlers/robots.txt.go48
-rw-r--r--views/pages/robots.txt5
2 files changed, 0 insertions, 53 deletions
diff --git a/internal/router/handlers/robots.txt.go b/internal/router/handlers/robots.txt.go
deleted file mode 100644
index fc60af4..0000000
--- a/internal/router/handlers/robots.txt.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package handlers
-
-import (
- "time"
-
- "github.com/SayaAndy/saya-today-web/internal/router"
- "github.com/gofiber/fiber/v2"
-)
-
-type RobotsTxtHandler struct {
- router.BasicHandler
-}
-
-func init() {
- router.Routes = append(router.Routes, &RobotsTxtHandler{})
-}
-
-func (r *RobotsTxtHandler) Filter() (method string, path string) {
- return "GET", "/robots.txt"
-}
-
-func (r *RobotsTxtHandler) IsTemplated() bool {
- return false
-}
-
-func (r *RobotsTxtHandler) TemplatesToInject() []string {
- return []string{"views/pages/robots.txt"}
-}
-
-func (r *RobotsTxtHandler) ToCache() router.CacheSetting {
- return router.ByUrlOnly
-}
-
-func (r *RobotsTxtHandler) CacheDuration() time.Duration {
- return time.Hour
-}
-
-func (r *RobotsTxtHandler) ToValidateLang() router.LangSetting {
- return router.NotRequired
-}
-
-func (r *RobotsTxtHandler) ContentType() string {
- return fiber.MIMETextPlainCharsetUTF8
-}
-
-func (r *RobotsTxtHandler) Render(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
- return fiber.StatusOK, nil
-}
diff --git a/views/pages/robots.txt b/views/pages/robots.txt
deleted file mode 100644
index 1e5bebb..0000000
--- a/views/pages/robots.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-User-agent: *
-Allow: /
-Disallow: /api/
-
-Sitemap: {{ .CanonicalEndpoint }}/sitemap.xml \ No newline at end of file