Example #1
0
func DefaultFuncs() template.FuncMap {
	_, err := compress.LoadJsonConf(Abs(settings.Static.CompressDef), true, settings.Server.Host)
	if err != nil {
		panic(err)

	}
	return template.FuncMap{
		"AssetJs": AssetJS,
	}
}
Example #2
0
func settingCompress() {
	setting, err := compress.LoadJsonConf(CompressConfPath, IsPro, "/")
	if err != nil {
		beego.Error(err)
		return
	}

	setting.RunCommand()

	if IsPro {
		setting.RunCompress(true, false, true)
	}

	beego.AddFuncMap("compress_js", setting.Js.CompressJs)
	beego.AddFuncMap("compress_css", setting.Css.CompressCss)
}
Example #3
0
File: conf.go Project: jexm/wego
func settingCompress() {
	setting, err := compress.LoadJsonConf(CompressConfPath, IsProMode, AppUrl)
	if err != nil {
		log.Error(err)
		return
	}

	setting.RunCommand()

	if IsProMode {
		setting.RunCompress(true, false, true)
	}

	Funcs["compress_js"] = setting.Js.CompressJs
	Funcs["compress_css"] = setting.Css.CompressCss
}
Example #4
0
func init() {
	setting, err := compress.LoadJsonConf("conf/compress.json", true, "/")
	if err != nil {
		panic("LoadJsonConf compress.json err:" + err.Error())
	}

	setting.RunCommand()

	setting.RunCompress(true, false, true)

	beego.AddFuncMap("compress_js", setting.Js.CompressJs)
	beego.AddFuncMap("compress_css", setting.Css.CompressCss)
	beego.AddFuncMap("i18n", i18n)
	beego.AddFuncMap("config", config)
	beego.AddFuncMap("docs", docs)
}
Example #5
0
func settingCompress() {
	AppUrl = beego.AppConfig.DefaultString("appurl", "")
	setting, err := compress.LoadJsonConf(CompressConfPath, IsProMode, AppUrl)
	if err != nil {
		beego.Error(err)
		return
	}

	setting.RunCommand()

	if IsProMode {
		setting.RunCompress(true, false, true)
	}

	beego.AddFuncMap("compress_js", setting.Js.CompressJs)
	beego.AddFuncMap("compress_css", setting.Css.CompressCss)
}