feat(setting): add site version information (#859)

* feat(setting): add site version information

* feat(conf): update conf.WebVersion to rolling

* fix(static): update condition to check conf.Version instead of conf.WebVersion

* fix(build.sh): use rolling release for web frontend in dev and beta builds

* chore(build.sh): update GitAuthor to The OpenList Projects Contributors

* fix(static): update condition to check conf.WebVersion
This commit is contained in:
MadDogOwner
2025-07-29 09:49:33 +08:00
committed by GitHub
parent e0b3a611ba
commit 7da06655cb
6 changed files with 26 additions and 33 deletions

View File

@ -43,9 +43,9 @@ func replaceStrings(content string, replacements map[string]string) string {
func initIndex(siteConfig SiteConfig) {
utils.Log.Debug("Initializing index.html...")
// dist_dir is empty and cdn is not empty add web_version is empty or beta or dev
if conf.Conf.DistDir == "" && conf.Conf.Cdn != "" && (conf.WebVersion == "" || conf.WebVersion == "beta" || conf.WebVersion == "dev") {
utils.Log.Infof("Fetching index.html from CDN: %s/index.html...", conf.Conf.Cdn)
// dist_dir is empty and cdn is not empty, and web_version is empty or beta or dev or rolling
if conf.Conf.DistDir == "" && conf.Conf.Cdn != "" && (conf.WebVersion == "" || conf.WebVersion == "beta" || conf.WebVersion == "dev" || conf.WebVersion == "rolling") {
utils.Log.Infof("Fetching index.html from CDN: %s/index.html...", siteConfig.Cdn)
resp, err := base.RestyClient.R().
SetHeader("Accept", "text/html").
Get(fmt.Sprintf("%s/index.html", siteConfig.Cdn))