Example #1
0
// Get implemented Get method for DocsRouter.
func (this *DocsRouter) Get() {
	// Set language version.
	curLang := globalSetting(this.Ctx, this.Input(), this.Data)

	this.Data["IsDocs"] = true

	reqUrl := this.Ctx.Request.URL.String()
	sec := reqUrl[strings.LastIndex(reqUrl, "/")+1:]
	if qm := strings.Index(sec, "?"); qm > -1 {
		sec = sec[:qm]
	}

	if len(sec) == 0 || sec == "docs" {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	} else {
		this.Data[sec] = true
	}

	df := models.GetDoc(sec, curLang.Lang)
	if df == nil {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	}

	beewatch.Display(beewatch.Info, "docFile.Title", df.Title,
		"section", sec)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplNames = "docs_" + curLang.Lang + ".html"
}
Example #2
0
// Get implemented Get method for QuickStartRouter.
func (this *QuickStartRouter) Get() {
	// Set language version.
	curLang := globalSetting(this.Ctx, this.Input(), this.Data)
	beewatch.Display(beewatch.Trace, "curLang", curLang)

	this.Data["IsQuickStart"] = true
	df := models.GetDoc("quickstart", curLang.Lang)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplNames = "quickstart_" + curLang.Lang + ".html"
}