-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy pathexplore.go
33 lines (30 loc) · 904 Bytes
/
explore.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package explore
import (
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/routers/web/shared"
"code.gitea.io/gitea/services/context"
)
// /explore/* routes
func ProvideExploreRoutes(m *web.Router) func() {
return func() {
m.Get("", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/explore/repos")
})
m.Get("/repos", Repos)
m.Get("/repos/sitemap-{idx}.xml", shared.SitemapEnabled, Repos)
m.Get("/users", Users)
m.Get("/users/sitemap-{idx}.xml", shared.SitemapEnabled, Users)
m.Get("/organizations", Organizations)
m.Get("/code", func(ctx *context.Context) {
if unit.TypeCode.UnitGlobalDisabled() {
ctx.NotFound(nil)
return
}
}, Code)
m.Get("/topics/search", TopicSearch)
}
}