Skip to content

Commit

Permalink
bee fix
Browse files Browse the repository at this point in the history
  • Loading branch information
astaxie committed Jan 27, 2016
1 parent d7b43ae commit 88de596
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions beeweb.go
Expand Up @@ -35,7 +35,7 @@ const (
func initialize() {
models.InitModels()

routers.IsPro = beego.RunMode == "prod"
routers.IsPro = beego.BConfig.RunMode == "prod"
if routers.IsPro {
beego.SetLevel(beego.LevelInformational)
os.Mkdir("./log", os.ModePerm)
Expand All @@ -49,13 +49,13 @@ func main() {

initialize()

beego.Info(beego.AppName, APP_VER)
beego.Info(beego.BConfig.AppName, APP_VER)

beego.InsertFilter("/docs/images/:all", beego.BeforeRouter, routers.DocsStatic)

if !routers.IsPro {
beego.SetStaticPath("/static_source", "static_source")
beego.DirectoryIndex = true
beego.BConfig.WebConfig.DirectoryIndex = true
}

beego.SetStaticPath("/products/images", "products/images/")
Expand Down
4 changes: 2 additions & 2 deletions models/models.go
Expand Up @@ -312,7 +312,7 @@ func getFile(filePath string) *docFile {
func GetDoc(fullName, lang string) *docFile {
filePath := "docs/" + lang + "/" + fullName

if beego.RunMode == "dev" {
if beego.BConfig.RunMode == "dev" {
return getFile(filePath)
}

Expand All @@ -325,7 +325,7 @@ func GetDoc(fullName, lang string) *docFile {
func GetBlog(fullName, lang string) *docFile {
filePath := "blog/" + lang + "/" + fullName

if beego.RunMode == "dev" {
if beego.BConfig.RunMode == "dev" {
return getFile(filePath)
}

Expand Down
2 changes: 1 addition & 1 deletion routers/blog.go
Expand Up @@ -28,7 +28,7 @@ type BlogRouter struct {
// Get implemented Get method for BlogRouter.
func (this *BlogRouter) Get() {
this.Data["IsBlog"] = true
this.TplNames = "blog.html"
this.TplName = "blog.html"

reqUrl := this.Ctx.Request.URL.String()
fullName := reqUrl[strings.LastIndex(reqUrl, "/")+1:]
Expand Down
2 changes: 1 addition & 1 deletion routers/community.go
Expand Up @@ -26,7 +26,7 @@ type CommunityRouter struct {
// Get implemented Get method for CommunityRouter.
func (this *CommunityRouter) Get() {
this.Data["IsCommunity"] = true
this.TplNames = "community.html"
this.TplName = "community.html"

df := models.GetDoc("usecases", this.Lang)
this.Data["Section"] = "usecases"
Expand Down
4 changes: 2 additions & 2 deletions routers/docs.go
Expand Up @@ -33,7 +33,7 @@ type DocsRouter struct {
// Get implemented Get method for DocsRouter.
func (this *DocsRouter) Get() {
this.Data["IsDocs"] = true
this.TplNames = "docs.html"
this.TplName = "docs.html"

dRoot := models.GetDocByLocale(this.Lang)

Expand Down Expand Up @@ -71,7 +71,7 @@ func (this *DocsRouter) Get() {
}

func DocsStatic(ctx *context.Context) {
if uri := ctx.Input.Params[":all"]; len(uri) > 0 {
if uri := ctx.Input.Param(":all"); len(uri) > 0 {
lang := ctx.GetCookie("lang")
if !i18n.IsExist(lang) {
lang = "en-US"
Expand Down
2 changes: 1 addition & 1 deletion routers/donate.go
Expand Up @@ -26,7 +26,7 @@ type DonateRouter struct {
// Get implemented Get method for DonateRouter.
func (this *DonateRouter) Get() {
this.Data["IsDonate"] = true
this.TplNames = "donate.html"
this.TplName = "donate.html"

// Get language.
df := models.GetDoc("donate", this.Lang)
Expand Down
2 changes: 1 addition & 1 deletion routers/home.go
Expand Up @@ -22,5 +22,5 @@ type HomeRouter struct {
// Get implemented Get method for HomeRouter.
func (this *HomeRouter) Get() {
this.Data["IsHome"] = true
this.TplNames = "home.html"
this.TplName = "home.html"
}
4 changes: 2 additions & 2 deletions routers/page.go
Expand Up @@ -10,7 +10,7 @@ type PageRouter struct {

func (this *PageRouter) Get() {
this.Data["IsTeam"] = true
this.TplNames = "team.html"
this.TplName = "team.html"

// Get language.
df := models.GetDoc("team", this.Lang)
Expand All @@ -24,7 +24,7 @@ type AboutRouter struct {

func (this *AboutRouter) Get() {
this.Data["IsAbout"] = true
this.TplNames = "about.html"
this.TplName = "about.html"

// Get language.
df := models.GetDoc("about", this.Lang)
Expand Down
2 changes: 1 addition & 1 deletion routers/products.go
Expand Up @@ -9,7 +9,7 @@ type ProductsRouter struct {
}

func (this *ProductsRouter) Get() {
this.TplNames = "products.html"
this.TplName = "products.html"
this.Data["IsProducts"] = true
this.Data["Products"] = models.Products
}
2 changes: 1 addition & 1 deletion routers/quickstart.go
Expand Up @@ -26,7 +26,7 @@ type QuickStartRouter struct {
// Get implemented Get method for QuickStartRouter.
func (this *QuickStartRouter) Get() {
this.Data["IsQuickStart"] = true
this.TplNames = "quickstart.html"
this.TplName = "quickstart.html"

df := models.GetDoc("quickstart", this.Lang)
this.Data["Section"] = "quickstart"
Expand Down
2 changes: 1 addition & 1 deletion routers/samples.go
Expand Up @@ -53,5 +53,5 @@ func (this *SamplesRouter) Get() {
this.Data["Title"] = df.Title
this.Data["Data"] = string(df.Data)
this.Data["IsHasMarkdown"] = true
this.TplNames = "samples_" + curLang.Lang + ".html"
this.TplName = "samples_" + curLang.Lang + ".html"
}
2 changes: 1 addition & 1 deletion routers/video.go
Expand Up @@ -24,7 +24,7 @@ type VideoRouter struct {
// Get implemented Get method for VideoRouter.
func (this *VideoRouter) Get() {
this.Data["IsVideo"] = true
this.TplNames = "video.html"
this.TplName = "video.html"

df := models.GetDoc("screencasts", this.Lang)
this.Data["Section"] = "screencasts"
Expand Down

0 comments on commit 88de596

Please sign in to comment.