From f142d61f01fc57cf7befe2cc71cc8a3f8b0fdc82 Mon Sep 17 00:00:00 2001
From: Kurococ Liu <21096362+KurococLiu@users.noreply.github.com>
Date: Sun, 23 Oct 2022 12:58:52 +0800
Subject: =?UTF-8?q?:newspaper:=20=20Add:=20=E5=8A=A0=E5=85=A5preconnect?=
=?UTF-8?q?=E3=80=81=E5=AD=97=E6=95=B0=E7=BB=9F=E8=AE=A1=EF=BC=8CReadme?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E7=9B=8ACDN=E5=90=8D=E5=8D=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
libs/Matcha.php | 36 +++++++++++++++++++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
(limited to 'libs/Matcha.php')
diff --git a/libs/Matcha.php b/libs/Matcha.php
index 1ec3c39..fd6135b 100644
--- a/libs/Matcha.php
+++ b/libs/Matcha.php
@@ -12,6 +12,7 @@ class Matcha
* 包括 css 引用、标题
*/
public static function head() {
+ Matcha::preconnect();
Matcha::linkCSS();
Matcha::iconfont();
Helper::options()->customHead();
@@ -68,7 +69,32 @@ class Matcha
echo '" />';
}
}
-
+
+ /**
+ * 输出 preconnect 标签
+ */
+ public static function preconnect() {
+ if(isset(Helper::options()->StaticCDN) && Helper::options()->StaticCDN!='local'){
+ if(Helper::options()->StaticCDN=='bytedance'){
+ $src_link = array(
+ '//lf3-cdn-tos.bytecdntp.com/',
+ '//lf9-cdn-tos.bytecdntp.com/',
+ '//lf26-cdn-tos.bytecdntp.com/',
+ );
+ }
+ elseif(Helper::options()->StaticCDN=='cdnjs'){
+ $src_link = array(
+ '://cdnjs.cloudflare.com/',
+ );
+ }
+ echo '';
+ foreach($src_link as $value){
+ echo '';
+ }
+
+ }
+ }
+
/**
* 引用 iconfont
*/
@@ -290,6 +316,14 @@ class Matcha
*/
static public function footerInfo()
{
+ //字数统计
+ if (Helper::options()->EnableWordsCounter=='able') {
+
+ echo '
';
+ echo '一共书写了';
+ WordsCounter_Plugin::allOfCharacters();
+ echo '字';
+ }
//备案号
if (Helper::options()->icpNum!='') {
echo '
';
--
cgit v1.2.3