Skip to content

Commit

Permalink
🍕 优化: 更新静态文件源 CDN (#136)
Browse files Browse the repository at this point in the history
❌ 删除 Staticfile & BootCDN
✔ 新增 Fastly & JsdMirror && snrat && zstatic
  • Loading branch information
Shiroko3 authored Mar 2, 2025
1 parent f4182b8 commit 2604c86
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
17 changes: 13 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,28 @@ function staticFiles($content, $type = 0, $isExternal = 0) {
}
switch($setting){
case 'jsdelivr':
$output = 'https://cdn.jsdelivr.net/gh/Bhaoo/Cuckoo@'.THEME_VERSION.'/assets/'.$content;
break;
case 'fastly':
$output = 'https://fastly.jsdelivr.net/gh/Bhaoo/Cuckoo@'.THEME_VERSION.'/assets/'.$content;
break;
case 'gcore':
$output = 'https://gcore.jsdelivr.net/gh/Bhaoo/Cuckoo@'.THEME_VERSION.'/assets/'.$content;
break;
case 'jsdmirror':
$output = 'https://cdn.jsdmirror.com/gh/Bhaoo/Cuckoo@'.THEME_VERSION.'/assets/'.$content;
break;
case 'cdn':
$output = Helper::options()->staticCdn.'/'.$content;
break;
case 'cdnjs':
$output = 'https://cdnjs.cloudflare.com/ajax/libs/Cuckoo/'.THEME_VERSION.'/'.$content;
break;
case 'staticfile':
$output = 'https://cdn.staticfile.org/Cuckoo/'.THEME_VERSION.'/'.$content;
case 'snrat':
$output = 'https://cdnjs.snrat.com/ajax/libs/Cuckoo/'.THEME_VERSION.'/'.$content;
break;
case 'bootcdn':
$output = 'https://cdn.bootcdn.net/ajax/libs/Cuckoo/'.THEME_VERSION.'/'.$content;
case 'zstatic':
$output = 'https://s4.zstatic.net/ajax/libs/Cuckoo/'.THEME_VERSION.'/'.$content;
break;
case 'baomitu':
$output = 'https://lib.baomitu.com/Cuckoo/'.THEME_VERSION.'/'.$content;
Expand Down
7 changes: 5 additions & 2 deletions includes/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,12 @@ function themeConfig($form) {
<?php echo $config->select('staticFiles',
['local' => '本地',
'jsdelivr' => 'JsDelivr',
'fastly' => 'Fastly',
'gcore' => 'Gcore',
'jsdmirror' => 'JsdMirror',
'cdnjs' => 'cdnjs',
'staticfile' => 'Staticfile',
'bootcdn' => 'Bootcdn',
'snrat' => 'snrat',
'zstatic' => 'zstatic',
'baomitu' => 'Baomitu',
'cdn' => '自定义 CDN'
], '静态文件源', '推荐选择 “JsDelivr源”', 'local').
Expand Down

0 comments on commit 2604c86

Please sign in to comment.