示例#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,
	}
}
示例#2
0
文件: init.go 项目: KiraPro/beeweb
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)
}
示例#3
0
文件: conf.go 项目: 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
}
示例#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)
}
示例#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)
}