mirror of https://github.com/vtrois/kratos
feat: add static resource acceleration (jsDelivr)
parent
433bde35c5
commit
4a4e8e2765
|
@ -4,10 +4,16 @@
|
|||
* 核心函数
|
||||
* @author Seaton Jiang <hi@seatonjiang.com>
|
||||
* @license GPL-3.0 License
|
||||
* @version 2023.03.28
|
||||
* @version 2023.03.30
|
||||
*/
|
||||
|
||||
define('ASSET_PATH', get_template_directory_uri());
|
||||
// CDN 资源地址
|
||||
if (kratos_option('g_cdn', false)) {
|
||||
$asset_path = 'https://cdn.jsdelivr.net/gh/seatonjiang/kratos@v' . THEME_VERSION;
|
||||
} else {
|
||||
$asset_path = get_template_directory_uri();
|
||||
}
|
||||
define('ASSET_PATH', $asset_path);
|
||||
|
||||
// 自动跳转主题设置
|
||||
function init_theme()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 主题选项
|
||||
* @author Seaton Jiang <hi@seatonjiang.com>
|
||||
* @license GPL-3.0 License
|
||||
* @version 2023.03.12
|
||||
* @version 2023.03.30
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
@ -120,6 +120,13 @@ CSF::createSection($prefix, array(
|
|||
'subtitle' => __('启用/禁用 Font Awesome Free 字体', 'kratos'),
|
||||
'default' => false,
|
||||
),
|
||||
array(
|
||||
'id' => 'g_cdn',
|
||||
'type' => 'switcher',
|
||||
'title' => __('静态资源加速', 'kratos'),
|
||||
'subtitle' => __('启用/禁用静态资源加速(jsDelivr)', 'kratos'),
|
||||
'default' => true,
|
||||
),
|
||||
array(
|
||||
'id' => 'g_renameimg',
|
||||
'type' => 'switcher',
|
||||
|
|
Loading…
Reference in New Issue