浏览代码

Added Sitemap

Yoginth 7 年之前
父节点
当前提交
4c09feb65b
共有 1 个文件被更改,包括 8 次插入12 次删除
  1. 8 12
      routes/user/sitemap.go

+ 8 - 12
routes/user/sitemap.go

@@ -12,18 +12,14 @@ type Urlset struct {
 }
 
 func Sitemap(w http.ResponseWriter, r *http.Request) {
+	profile := Urlset{"https://gitote.in/", "Daily", "1.0"}
 
-	for i := 0; i < 0; i++ {
-
-		profile := Urlset{"dfsdf", "dgg", "fsdjfn"}
-
-		x, err := xml.MarshalIndent(profile, "", "  ")
-		if err != nil {
-			http.Error(w, err.Error(), http.StatusInternalServerError)
-			return
-		}
-
-		w.Header().Set("Content-Type", "application/xml")
-		w.Write(x)
+	x, err := xml.MarshalIndent(profile, "", "  ")
+	if err != nil {
+		http.Error(w, err.Error(), http.StatusInternalServerError)
+		return
 	}
+
+	w.Header().Set("Content-Type", "application/xml")
+	w.Write(x)
 }