| 35 | var static fs.FS |
| 36 | |
| 37 | func initStatic() { |
| 38 | utils.Log.Debug("Initializing static file system...") |
| 39 | if conf.Conf.DistDir == "" { |
| 40 | dist, err := fs.Sub(public.Public, "dist") |
| 41 | if err != nil { |
| 42 | utils.Log.Fatalf("failed to read dist dir: %v", err) |
| 43 | } |
| 44 | static = dist |
| 45 | utils.Log.Debug("Using embedded dist directory") |
| 46 | return |
| 47 | } |
| 48 | static = os.DirFS(conf.Conf.DistDir) |
| 49 | utils.Log.Infof("Using custom dist directory: %s", conf.Conf.DistDir) |
| 50 | } |
| 51 | |
| 52 | func replaceStrings(content string, replacements map[string]string) string { |
| 53 | for old, new := range replacements { |