@@ -15,20 +15,21 @@ import (
15
15
"strings"
16
16
17
17
"code.gitea.io/git"
18
+ "code.gitea.io/gitea/conf"
18
19
"code.gitea.io/gitea/models"
19
20
"code.gitea.io/gitea/modules/auth"
20
- "code.gitea.io/gitea/modules/bindata"
21
21
"code.gitea.io/gitea/modules/context"
22
22
"code.gitea.io/gitea/modules/log"
23
23
"code.gitea.io/gitea/modules/setting"
24
- "code.gitea.io/gitea/modules/template "
24
+ "code.gitea.io/gitea/public "
25
25
"code.gitea.io/gitea/routers"
26
26
"code.gitea.io/gitea/routers/admin"
27
27
apiv1 "code.gitea.io/gitea/routers/api/v1"
28
28
"code.gitea.io/gitea/routers/dev"
29
29
"code.gitea.io/gitea/routers/org"
30
30
"code.gitea.io/gitea/routers/repo"
31
31
"code.gitea.io/gitea/routers/user"
32
+ "code.gitea.io/gitea/templates"
32
33
"github.com/go-macaron/bindata"
33
34
"github.com/go-macaron/binding"
34
35
"github.com/go-macaron/cache"
@@ -86,17 +87,10 @@ func newMacaron() *macaron.Macaron {
86
87
if setting .Protocol == setting .FCGI {
87
88
m .SetURLPrefix (setting .AppSubURL )
88
89
}
89
- m .Use (macaron .Static (
90
- " public" ,
91
- macaron. StaticOptions {
90
+ m .Use (public .Static (
91
+ & public. Options {
92
+ Directory : path . Join ( setting . StaticRootPath , "public" ),
92
93
SkipLogging : setting .DisableRouterLog ,
93
- FileSystem : bindata .Static (bindata.Options {
94
- Asset : public .Asset ,
95
- AssetDir : public .AssetDir ,
96
- AssetInfo : public .AssetInfo ,
97
- AssetNames : public .AssetNames ,
98
- Prefix : "" ,
99
- }),
100
94
},
101
95
))
102
96
m .Use (macaron .Static (
@@ -107,23 +101,23 @@ func newMacaron() *macaron.Macaron {
107
101
},
108
102
))
109
103
110
- templateOptions := bindata.Options {
111
- Asset : templates .Asset ,
112
- AssetDir : templates .AssetDir ,
113
- AssetInfo : templates .AssetInfo ,
114
- AssetNames : templates .AssetNames ,
115
- Prefix : "" ,
116
- }
104
+ m .Use (templates .Renderer (
105
+ & templates.Options {
106
+ Directory : path .Join (setting .StaticRootPath , "templates" ),
107
+ AppendDirectories : []string {path .Join (setting .CustomPath , "templates" )},
108
+ },
109
+ ))
117
110
118
- funcMap := template .NewFuncMap ()
119
- m .Use (macaron .Renderer (macaron.RenderOptions {
120
- AppendDirectories : []string {path .Join (setting .CustomPath , "templates" )},
121
- Funcs : funcMap ,
122
- IndentJSON : macaron .Env != macaron .PROD ,
123
- TemplateFileSystem : bindata .Templates (templateOptions ),
124
- }))
125
- models .InitMailRender (templateOptions ,
126
- path .Join (setting .CustomPath , "templates/mail" ), funcMap )
111
+ // templateOptions := bindata.Options{
112
+ // Asset: templates.Asset,
113
+ // AssetDir: templates.AssetDir,
114
+ // AssetInfo: templates.AssetInfo,
115
+ // AssetNames: templates.AssetNames,
116
+ // Prefix: "",
117
+ // }
118
+
119
+ // models.InitMailRender(templateOptions,
120
+ // path.Join(setting.CustomPath, "templates/mail"), funcMap)
127
121
128
122
localeNames , err := conf .AssetDir ("locale" )
129
123
if err != nil {
0 commit comments