summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/release.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/release.go')
-rw-r--r--routers/web/repo/release.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/routers/web/repo/release.go b/routers/web/repo/release.go
index 2047a1cfb9..54f503642b 100644
--- a/routers/web/repo/release.go
+++ b/routers/web/repo/release.go
@@ -23,6 +23,7 @@ import (
"code.gitea.io/gitea/modules/upload"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/modules/web"
+ "code.gitea.io/gitea/routers/web/feed"
"code.gitea.io/gitea/services/forms"
releaseservice "code.gitea.io/gitea/services/release"
)
@@ -199,6 +200,30 @@ func releasesOrTags(ctx *context.Context, isTagList bool) {
ctx.HTML(http.StatusOK, tplReleases)
}
+// ReleasesFeedRSS get feeds for releases in RSS format
+func ReleasesFeedRSS(ctx *context.Context) {
+ releasesOrTagsFeed(ctx, true, "rss")
+}
+
+// TagsListFeedRSS get feeds for tags in RSS format
+func TagsListFeedRSS(ctx *context.Context) {
+ releasesOrTagsFeed(ctx, false, "rss")
+}
+
+// ReleasesFeedAtom get feeds for releases in Atom format
+func ReleasesFeedAtom(ctx *context.Context) {
+ releasesOrTagsFeed(ctx, true, "atom")
+}
+
+// TagsListFeedAtom get feeds for tags in RSS format
+func TagsListFeedAtom(ctx *context.Context) {
+ releasesOrTagsFeed(ctx, false, "atom")
+}
+
+func releasesOrTagsFeed(ctx *context.Context, isReleasesOnly bool, formatType string) {
+ feed.ShowReleaseFeed(ctx, ctx.Repo.Repository, isReleasesOnly, formatType)
+}
+
// SingleRelease renders a single release's page
func SingleRelease(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.release.releases")