diff options
| author | BigCoke233 <hi@guhub.cn> | 2020-04-15 17:26:50 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2020-04-15 17:26:50 +0800 |
| commit | 3def1ca01fc20e6f6da887182202f10047e3a912 (patch) | |
| tree | c9aac5f5fc2cefb94b4903a56fde0cbba0877bd5 /functions.php | |
| parent | 7866c9f6a2353fd93a279b5a22872c52bb81b08b (diff) | |
:alien: Add: 添加 9jojo CDN 作为静态文件加速选择
Diffstat (limited to 'functions.php')
| -rw-r--r-- | functions.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/functions.php b/functions.php index 1ddceb2..d6d4f73 100644 --- a/functions.php +++ b/functions.php @@ -82,24 +82,29 @@ array_push($views, $cid); */ function generate_require($files,$type,$cdn,$custom) { if ($cdn=='1'){ - $path = 'https://cdn.jsdelivr.net/gh/BigCoke233/miracles@'.themeVersion()."/"; + $path = 'https://cdn.jsdelivr.net/gh/BigCoke233/miracles@'.themeVersion()."/assets/"; } elseif ($cdn=='2'){ - $path = 'https://raw.githack.com/BigCoke233/miracles/master/'; + $path = 'https://raw.githack.com/BigCoke233/miracles/master/assets/'; } elseif ($cdn=='4'){ - $path = 'https://rawcdn.githack.com/BigCoke233/miracles/master/'; + $path = 'https://rawcdn.githack.com/BigCoke233/miracles/master/assets/'; + } + elseif ($cdn=='5'){ + $path = 'https://cdn.9jojo.cn/Miracles/'; } elseif ($cdn=='3'){ $path = $custom; }else{ - $path = Helper::options()->themeUrl("","Miracles"); + $path = Helper::options()->themeUrl("","Miracles/assets"); } foreach ($files as $file) { - if ($type == "js") - echo "<script src=".$path."assets/".$type."/".$file.".".$type."></script>"; - elseif ($type == "css") - echo "<link rel=\"stylesheet\" href=".$path."assets/".$type."/".$file.".".$type." />"; + if ($type == "js"){ + echo "<script src=".$path. $type."/".$file.".".$type."></script>"; + } + elseif ($type == "css"){ + echo "<link rel=\"stylesheet\" href=".$path. $type."/".$file.".".$type." />"; + } } } |
