aboutsummaryrefslogtreecommitdiff
path: root/internal/template/template.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-22 09:05:26 +0800
committerGitHub <noreply@github.com>2020-02-22 09:05:26 +0800
commit648d9e253c1924b832248f26fee42b2fb64dc3bc (patch)
tree51649fad974cd7284a47d30e412c90e7ab72cd2c /internal/template/template.go
parent5b14cc6f0b7b661beb2640a94bd15660cdb48587 (diff)
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
Diffstat (limited to 'internal/template/template.go')
-rw-r--r--internal/template/template.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/template/template.go b/internal/template/template.go
index 2c169a4a..21c2c549 100644
--- a/internal/template/template.go
+++ b/internal/template/template.go
@@ -21,9 +21,9 @@ import (
"golang.org/x/text/transform"
log "unknwon.dev/clog/v2"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/db"
"gogs.io/gogs/internal/markup"
- "gogs.io/gogs/internal/setting"
"gogs.io/gogs/internal/tool"
)
@@ -40,28 +40,28 @@ func FuncMap() []template.FuncMap {
return time.Now().Year()
},
"UseHTTPS": func() bool {
- return strings.HasPrefix(setting.AppURL, "https")
+ return conf.Server.URL.Scheme == "https"
},
"AppName": func() string {
- return setting.AppName
+ return conf.App.BrandName
},
"AppSubURL": func() string {
- return setting.AppSubURL
+ return conf.Server.Subpath
},
"AppURL": func() string {
- return setting.AppURL
+ return conf.Server.ExternalURL
},
"AppVer": func() string {
- return setting.AppVersion
+ return conf.App.Version
},
"AppDomain": func() string {
- return setting.Domain
+ return conf.Server.Domain
},
"DisableGravatar": func() bool {
- return setting.DisableGravatar
+ return conf.DisableGravatar
},
"ShowFooterTemplateLoadTime": func() bool {
- return setting.ShowFooterTemplateLoadTime
+ return conf.ShowFooterTemplateLoadTime
},
"LoadTimes": func(startTime time.Time) string {
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
@@ -111,7 +111,7 @@ func FuncMap() []template.FuncMap {
"EscapePound": EscapePound,
"RenderCommitMessage": RenderCommitMessage,
"ThemeColorMetaTag": func() string {
- return setting.UI.ThemeColorMetaTag
+ return conf.UI.ThemeColorMetaTag
},
"FilenameIsImage": func(filename string) bool {
mimeType := mime.TypeByExtension(filepath.Ext(filename))