1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

RSS/Atom support for Repos (#19055)

* support for repos
* refactor
* advertise the feeds via meta tags
* allow feed suffix and feed header
* optimize performance
This commit is contained in:
6543
2022-03-13 17:40:47 +01:00
committed by GitHub
parent 780cf76f6e
commit bc0d2c8ada
14 changed files with 188 additions and 110 deletions

View File

@@ -38,6 +38,7 @@ import (
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/typesniffer"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/web/feed"
)
const (
@@ -691,6 +692,14 @@ func checkHomeCodeViewable(ctx *context.Context) {
// Home render repository home page
func Home(ctx *context.Context) {
isFeed, _, showFeedType := feed.GetFeedType(ctx.Params(":reponame"), ctx.Req)
if isFeed {
feed.ShowRepoFeed(ctx, ctx.Repo.Repository, showFeedType)
return
}
ctx.Data["FeedURL"] = ctx.Repo.Repository.HTMLURL()
checkHomeCodeViewable(ctx)
if ctx.Written() {
return