fix(static): correct CDN fetch condition for index.html (#814)

This commit is contained in:
MadDogOwner
2025-07-24 22:28:58 +08:00
committed by GitHub
parent c2271df64e
commit 4106e2a996

View File

@ -44,7 +44,8 @@ func replaceStrings(content string, replacements map[string]string) string {
func initIndex() {
utils.Log.Debug("Initializing index.html...")
siteConfig := getSiteConfig()
if conf.Conf.DistDir != "" || (conf.Conf.Cdn != "" && (conf.WebVersion == "" || conf.WebVersion == "beta" || conf.WebVersion == "dev")) {
// 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)
resp, err := base.RestyClient.R().
SetHeader("Accept", "text/html").