Browse Source

Remove Sitemap and Closes #52

Yoginth 6 năm trước cách đây
mục cha
commit
fd71dea3e4

+ 0 - 7
cmd/web.go

@@ -307,13 +307,6 @@ func runWeb(c *cli.Context) error {
 
 	// ***** END: Pages *****
 
-	m.Group("/sitemap", func() {
-		m.Get("", ignSignIn, admin.Sitemap)
-		m.Get("/users", ignSignIn, admin.UserSitemap)
-		m.Get("/orgs", ignSignIn, admin.OrgSitemap)
-		m.Get("/repos", ignSignIn, admin.RepoSitemap)
-	})
-
 	// ***** START: Embed *****
 	m.Get("/embed/user/:username", ignSignIn, user.Embed)
 	// ***** END: Embed *****

+ 0 - 81
routes/admin/sitemap.go

@@ -1,81 +0,0 @@
-// Copyright 2015 - Present, The Gogs Authors. All rights reserved.
-// Copyright 2018 - Present, Gitote. All rights reserved.
-//
-// This source code is licensed under the MIT license found in the
-// LICENSE file in the root directory of this source tree.
-
-package admin
-
-import (
-	"gitote/gitote/models"
-	"gitote/gitote/pkg/context"
-	"gitote/gitote/routes"
-)
-
-const (
-	// SitemapTPL page template
-	SitemapTPL = "sitemap"
-
-	// UserSitemapTPL page template
-	UserSitemapTPL = "user/sitemap"
-
-	// OrgSitemapTPL page template
-	OrgSitemapTPL = "org/sitemap"
-
-	// RepoSitemapTPL page template
-	RepoSitemapTPL = "repo/sitemap"
-)
-
-// Sitemap shows about page
-func Sitemap(c *context.Context) {
-	c.HTML(200, SitemapTPL)
-}
-
-// UserSitemap shows about page
-func UserSitemap(c *context.Context) {
-	routes.RenderUserSearch(c, &routes.UserSearchOptions{
-		Type:    models.UserTypeIndividual,
-		Counter: models.CountUsers,
-		Ranger:  models.Users,
-		OrderBy: "id ASC",
-		TplName: UserSitemapTPL,
-	})
-}
-
-// OrgSitemap shows about page
-func OrgSitemap(c *context.Context) {
-	routes.RenderUserSearch(c, &routes.UserSearchOptions{
-		Type:    models.UserTypeOrganization,
-		Counter: models.CountOrganizations,
-		Ranger:  models.Organizations,
-		OrderBy: "id ASC",
-		TplName: OrgSitemapTPL,
-	})
-}
-
-// RepoSitemap shows about page
-func RepoSitemap(c *context.Context) {
-	page := c.QueryInt("page")
-
-	var (
-		repos []*models.Repository
-		count int64
-		err   error
-	)
-
-	repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{
-		OrderBy: "id ASC",
-		Private: false,
-		Page:    page,
-	})
-
-	c.Data["Total"] = count
-
-	if err = models.RepositoryList(repos).LoadAttributes(); err != nil {
-		c.Handle(500, "LoadAttributes", err)
-		return
-	}
-	c.Data["Repos"] = repos
-
-	c.HTML(200, RepoSitemapTPL)
-}

+ 0 - 3
templates/org/sitemap.tmpl

@@ -1,3 +0,0 @@
-{{range .Users}}
-https://gitote.in/{{.Name}}
-{{end}}

+ 0 - 3
templates/repo/sitemap.tmpl

@@ -1,3 +0,0 @@
-{{range .Repos}}
-https://gitote.in/{{.Owner.Name}}/{{.Name}}
-{{end}}

+ 0 - 1
templates/sitemap.tmpl

@@ -1 +0,0 @@
-https://gitote.yoginth.com

+ 0 - 3
templates/user/sitemap.tmpl

@@ -1,3 +0,0 @@
-{{range .Users}}
-https://gitote.in/{{.Name}}
-{{end}}