mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Allow disable RSS/Atom feed (#21622)
This patch provide a mechanism to disable RSS/Atom feed. Signed-off-by: Xinyu Zhou <i@sourcehut.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -771,13 +771,16 @@ func checkCitationFile(ctx *context.Context, entry *git.TreeEntry) {
 | 
			
		||||
 | 
			
		||||
// 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
 | 
			
		||||
	}
 | 
			
		||||
	if setting.EnableFeed {
 | 
			
		||||
		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()
 | 
			
		||||
		ctx.Data["EnableFeed"] = true
 | 
			
		||||
		ctx.Data["FeedURL"] = ctx.Repo.Repository.HTMLURL()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	checkHomeCodeViewable(ctx)
 | 
			
		||||
	if ctx.Written() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user