From 2c028cef411a2eae19c82b7b89fedb9b8b191b4f Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Fri, 17 Jul 2020 00:15:54 +0800 Subject: =?UTF-8?q?=F0=9F=96=BC=EF=B8=8F=20Perf:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=94=A8=20cdn=20=E5=8A=A0=E9=80=9F=E6=87=92=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- functions.php | 2 ++ index.php | 2 +- libs/Contents.php | 10 +++++----- libs/Options.php | 1 + libs/Utils.php | 35 ++++++++++++++++++++++++++++++++++- 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 21e4e76..c780513 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,7 @@ $ git clone https://github.com/BigCoke233/miracles.git - [x] 新增:添加语言包功能,通过 php 数组储存各个语言版本的文字 - [x] 优化:文章缩略图自动剪裁 - [x] 优化:页面/文章评论列表隐藏时,不显示评论数 +- [x] 优化:支持用 jsDelivr 加速主题内置图片的速度 - [ ] 增加:内置站点缓存规则 - [ ] 优化:「说说页面」的样式 - [ ] 新增:图片横向排版「相册功能」(参考:https://blog.imalan.cn/archives/282/) @@ -190,7 +191,6 @@ $ git clone https://github.com/BigCoke233/miracles.git - [ ] 优化:对日间模式/日落模式/夜间模式的切换通过下拉面板操作,并支持禁用主题跟随系统设置 - [ ] 新增:导航支持下拉面板 - [ ] 优化:优化夜间模式的切换机制 -- [ ] 优化:支持用 jsDelivr 加速主题内置图片的速度 ## 💖 鸣谢 diff --git a/functions.php b/functions.php index 3a61c87..3903fc3 100644 --- a/functions.php +++ b/functions.php @@ -35,6 +35,8 @@ function themeInit($archive) { Helper::options()->commentsCheckReferer = false;//关闭检查评论来源URL与文章链接是否一致判断(否则会无法评论) //将设置储存到全局变量以便使用 $GLOBALS['miraclesOptions_randomBanner'] = Helper::options()->randomBanner; + $GLOBALS['miraclesOptions_CDN'] = Helper::options()->CDN; + $GLOBALS['miraclesOptions_loading_image'] = Helper::options()->loading_image; } /** diff --git a/index.php b/index.php index b432a4e..f811747 100644 --- a/index.php +++ b/index.php @@ -22,7 +22,7 @@ $this->need('includes/header.php');
- +
diff --git a/libs/Contents.php b/libs/Contents.php index 567c3b2..d821b72 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -26,7 +26,7 @@ class Contents //ParseOther $text = Contents::parseDetails(Contents::parsePicShadow(Contents::parseNotice(Contents::parseKbd(Contents::parseCode(Contents::parseImages(Contents::parseHeadings(Contents::parseTextColor(Contents::parseRuby(Contents::parseTip($text)))))))))); //LazyLoad - $text = preg_replace('//','',$text); + $text = preg_replace('//','',$text); //owo $text = Contents::parseEmo($text); //Links @@ -110,7 +110,7 @@ class Contents $rp = '