Skip to content

Commit 609a627

Browse files
Add [other].SHOW_FOOTER_POWERED_BY setting to hide Powered by (#30253)
This allows you to hide the "Powered by" text in footer via `SHOW_FOOTER_POWERED_BY` flag in configuration. --------- Co-authored-by: silverwind <[email protected]>
1 parent 0ceecfc commit 609a627

File tree

6 files changed

+12
-1
lines changed

6 files changed

+12
-1
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,8 @@ LEVEL = Info
23152315
;SHOW_FOOTER_VERSION = true
23162316
;; Show template execution time in the footer
23172317
;SHOW_FOOTER_TEMPLATE_LOAD_TIME = true
2318+
;; Show the "powered by" text in the footer
2319+
;SHOW_FOOTER_POWERED_BY = true
23182320
;; Generate sitemap. Defaults to `true`.
23192321
;ENABLE_SITEMAP = true
23202322
;; Enable/Disable RSS/Atom feed

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,5 +1429,6 @@ Like `uses: https://gitea.com/actions/checkout@v4` or `uses: http://your-git-ser
14291429

14301430
- `SHOW_FOOTER_VERSION`: **true**: Show Gitea and Go version information in the footer.
14311431
- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer.
1432+
- `SHOW_FOOTER_POWERED_BY`: **true**: Show the "powered by" text in the footer.
14321433
- `ENABLE_SITEMAP`: **true**: Generate sitemap.
14331434
- `ENABLE_FEED`: **true**: Enable/Disable RSS/Atom feed.

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,5 +1353,6 @@ PROXY_HOSTS = *.github.com
13531353

13541354
- `SHOW_FOOTER_VERSION`: **true**: 在页面底部显示Gitea的版本。
13551355
- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: 在页脚显示模板执行的时间。
1356+
- `SHOW_FOOTER_POWERED_BY`: **true**: 在页脚显示“由...提供动力”的文本。
13561357
- `ENABLE_SITEMAP`: **true**: 生成sitemap.
13571358
- `ENABLE_FEED`: **true**: 是否启用RSS/Atom

modules/setting/other.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import "code.gitea.io/gitea/modules/log"
88
type OtherConfig struct {
99
ShowFooterVersion bool
1010
ShowFooterTemplateLoadTime bool
11+
ShowFooterPoweredBy bool
1112
EnableFeed bool
1213
EnableSitemap bool
1314
}
1415

1516
var Other = OtherConfig{
1617
ShowFooterVersion: true,
1718
ShowFooterTemplateLoadTime: true,
19+
ShowFooterPoweredBy: true,
1820
EnableSitemap: true,
1921
EnableFeed: true,
2022
}

modules/templates/helper.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ func NewFuncMap() template.FuncMap {
106106
"ShowFooterTemplateLoadTime": func() bool {
107107
return setting.Other.ShowFooterTemplateLoadTime
108108
},
109+
"ShowFooterPoweredBy": func() bool {
110+
return setting.Other.ShowFooterPoweredBy
111+
},
109112
"AllowedReactions": func() []string {
110113
return setting.UI.Reactions
111114
},

templates/base/footer_content.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}">
22
<div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}">
3-
<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a>
3+
{{if ShowFooterPoweredBy}}
4+
<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a>
5+
{{end}}
46
{{if (or .ShowFooterVersion .PageIsAdmin)}}
57
{{ctx.Locale.Tr "version"}}:
68
{{if .IsAdmin}}

0 commit comments

Comments
 (0)