summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorXinyu Zhou <i@sourcehut.net>2022-11-21 13:14:58 +0800
committerGitHub <noreply@github.com>2022-11-21 13:14:58 +0800
commitb4802b9b2eae044e35f022dc7116986e4762a944 (patch)
tree797be6fa1bff09a869c03344d4d01cb5710b9973 /templates
parent9380bb6d0c7fb8d2652d19a9aec87994a6e99f8c (diff)
downloadgitea-b4802b9b2eae044e35f022dc7116986e4762a944.tar.gz
gitea-b4802b9b2eae044e35f022dc7116986e4762a944.zip
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>
Diffstat (limited to 'templates')
-rw-r--r--templates/base/head.tmpl2
-rw-r--r--templates/org/home.tmpl4
-rw-r--r--templates/repo/header.tmpl4
-rw-r--r--templates/user/profile.tmpl4
4 files changed, 10 insertions, 4 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index 70a88ff755..e2fc8434aa 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -15,7 +15,7 @@
<meta name="go-import" content="{{.GoGetImport}} git {{.RepoCloneLink.HTTPS}}">
<meta name="go-source" content="{{.GoGetImport}} _ {{.GoDocDirectory}} {{.GoDocFile}}">
{{end}}
-{{if .FeedURL}}
+{{if and .EnableFeed .FeedURL}}
<link rel="alternate" type="application/atom+xml" title="" href="{{.FeedURL}}.atom">
<link rel="alternate" type="application/rss+xml" title="" href="{{.FeedURL}}.rss">
{{end}}
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl
index 448639975f..358f045bc6 100644
--- a/templates/org/home.tmpl
+++ b/templates/org/home.tmpl
@@ -5,7 +5,9 @@
<div id="org-info">
<div class="ui header">
{{.Org.DisplayName}}
- <a href="{{.Org.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.locale.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 36}}</i></a>
+ {{if .EnableFeed}}
+ <a href="{{.Org.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.locale.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 36}}</i></a>
+ {{end}}
<span class="org-visibility">
{{if .Org.Visibility.IsLimited}}<div class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .Org.Visibility.IsPrivate}}<div class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 831784a623..e6bd839f57 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -13,7 +13,9 @@
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
<div class="mx-2">/</div>
<a href="{{$.RepoLink}}">{{.Name}}</a>
- <a href="{{$.RepoLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{$.locale.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 18}}</i></a>
+ {{if $.EnableFeed}}
+ <a href="{{$.RepoLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{$.locale.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 18}}</i></a>
+ {{end}}
<div class="labels df ac fw">
{{if .IsTemplate}}
{{if .IsPrivate}}
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 3b776bc16d..70a49235ed 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -18,7 +18,9 @@
<div class="content word-break profile-avatar-name">
{{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
<span class="username text center">{{.Owner.Name}}</span>
- <a href="{{.Owner.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.locale.Tr "rss_feed"}}" data-position="bottom center">{{svg "octicon-rss" 18}}</i></a>
+ {{if .EnableFeed}}
+ <a href="{{.Owner.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.locale.Tr "rss_feed"}}" data-position="bottom center">{{svg "octicon-rss" 18}}</i></a>
+ {{end}}
<div class="mt-3">
<a class="muted" href="{{.Owner.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "mr-2"}}{{.Owner.NumFollowers}} {{.locale.Tr "user.followers"}}</a> ยท <a class="muted" href="{{.Owner.HomeLink}}?tab=following">{{.Owner.NumFollowing}} {{.locale.Tr "user.following"}}</a>
</div>