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, } }
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) }
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 }
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) }
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) }