forked from forgejo/forgejo
Able to config app name
This commit is contained in:
parent
d87ea87aee
commit
d4728fafaf
2 changed files with 9 additions and 2 deletions
9
web.go
9
web.go
|
@ -6,6 +6,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
|
||||
"github.com/codegangsta/cli"
|
||||
|
@ -30,13 +31,19 @@ gogs web`,
|
|||
},
|
||||
}
|
||||
|
||||
var AppHelpers template.FuncMap = map[string]interface{}{
|
||||
"AppName": func() string {
|
||||
return utils.Cfg.MustValue("", "APP_NAME")
|
||||
},
|
||||
}
|
||||
|
||||
func runWeb(*cli.Context) {
|
||||
log.Info("%s %s", utils.Cfg.MustValue("", "APP_NAME"), APP_VER)
|
||||
|
||||
m := martini.Classic()
|
||||
|
||||
// Middleware.
|
||||
m.Use(render.Renderer())
|
||||
m.Use(render.Renderer(render.Options{Funcs: []template.FuncMap{AppHelpers}}))
|
||||
|
||||
// Routers.
|
||||
m.Get("/", routers.Dashboard)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue