From 8a03995d72a9afe999c243cffd1fae05b441c172 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Sun, 12 Apr 2020 15:34:50 +0800 Subject: =?UTF-8?q?:books:=20Add:=20=E6=94=AF=E6=8C=81=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=20CDN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 552454b..be3fccc 100644 --- a/functions.php +++ b/functions.php @@ -80,10 +80,18 @@ array_push($views, $cid); /** * 自动生成引用 */ -function generate_require($files,$type,$cdn = NULL) { - if ($cdn) - $path = $cdn.themeVersion()."/"; - else $path = Helper::options()->themeUrl("","Miracles"); +function generate_require($files,$type,$cdn,$custom) { + if ($cdn=='1'){ + $path = 'https://cdn.jsdelivr.net/gh/BigCoke233/miracles@'.themeVersion()."/"; + } + elseif ($cdn=='2'){ + $path = 'http://raw.githack.com/BigCoke233/miracles/master/'; + } + elseif ($cdn=='3'){ + $path = $custom; + }else{ + $path = Helper::options()->themeUrl("","Miracles"); + } foreach ($files as $file) { if ($type == "js") echo ""; -- cgit v1.2.3