gitea源码

render.go 588B

1234567891011121314151617181920212223242526
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package feed
  4. import (
  5. "code.gitea.io/gitea/services/context"
  6. )
  7. // RenderBranchFeed render format for branch or file
  8. func RenderBranchFeed(ctx *context.Context, feedType string) {
  9. if ctx.Repo.TreePath == "" {
  10. ShowBranchFeed(ctx, ctx.Repo.Repository, feedType)
  11. } else {
  12. ShowFileFeed(ctx, ctx.Repo.Repository, feedType)
  13. }
  14. }
  15. func RenderBranchFeedRSS(ctx *context.Context) {
  16. RenderBranchFeed(ctx, "rss")
  17. }
  18. func RenderBranchFeedAtom(ctx *context.Context) {
  19. RenderBranchFeed(ctx, "atom")
  20. }