2023-04-25 16:08:29 +02:00
|
|
|
// Copyright 2022 The Gitea Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
package feed
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// RenderBranchFeed render format for branch or file
|
2023-10-20 11:40:32 +02:00
|
|
|
func RenderBranchFeed(feedType string) func(ctx *context.Context) {
|
|
|
|
return func(ctx *context.Context) {
|
|
|
|
if ctx.Repo.TreePath == "" {
|
|
|
|
ShowBranchFeed(ctx, ctx.Repo.Repository, feedType)
|
|
|
|
} else {
|
|
|
|
ShowFileFeed(ctx, ctx.Repo.Repository, feedType)
|
|
|
|
}
|
2023-04-25 16:08:29 +02:00
|
|
|
}
|
|
|
|
}
|