From d9e677d6cd90b9c868d505f5177868090dbf1842 Mon Sep 17 00:00:00 2001
From: Kurococ Liu <21096362+KurococLiu@users.noreply.github.com>
Date: Sun, 23 Oct 2022 09:46:21 +0800
Subject: =?UTF-8?q?:+1:=20Perf:=20=E4=BC=98=E5=8C=96Gravatar=E5=9B=BD?=
=?UTF-8?q?=E5=86=85=E9=95=9C=E5=83=8F=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
libs/Comments.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'libs')
diff --git a/libs/Comments.php b/libs/Comments.php
index 0d3b3b1..c31dc7d 100644
--- a/libs/Comments.php
+++ b/libs/Comments.php
@@ -42,7 +42,7 @@ Class Comments {
{
//MD5 EMail
$email = md5($email);
- $avatar = 'https://gravatar.loli.net/avatar/' . $email . '?s=' . $size;
+ $avatar = 'https://cravatar.cn/avatar/' . $email . '?s=' . $size;
return $avatar;
}
--
cgit v1.2.3
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 +++++++++++++++++++++++++++++++++++-
libs/Options.php | 12 ++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
(limited to 'libs')
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 '
';
diff --git a/libs/Options.php b/libs/Options.php
index fde322b..04384c0 100644
--- a/libs/Options.php
+++ b/libs/Options.php
@@ -133,6 +133,18 @@ function themeConfig($form) {
')
);
$form->addInput($EnableBusuanzi->addRule('required', _t('此处必须设置')));
+ //启用字数统计
+ $EnableWordsCounter = new Typecho_Widget_Helper_Form_Element_Radio('EnableWordsCounter', array(
+ 'able' => _t('启用'),
+ 'disable' => _t('停用'),
+ ),
+ 'able',
+ _t('是否启用 字数统计 功能'),
+ _t('
+ 字数统计是一个基于WordsCounter插件统计全站字数的,默认启用
+ ')
+ );
+ $form->addInput($EnableWordsCounter->addRule('required', _t('此处必须设置')));
/**
* 自定义 & 开发者设置
--
cgit v1.2.3
From 7d43a015736099c950e2edd16fe4cd3788a83b80 Mon Sep 17 00:00:00 2001
From: Kurococ Liu <21096362+KurococLiu@users.noreply.github.com>
Date: Tue, 1 Nov 2022 13:04:56 +0800
Subject: =?UTF-8?q?:bug:=20Fix:=20=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=AD?=
=?UTF-8?q?=E5=AD=97=E6=95=B0=E7=BB=9F=E8=AE=A1=E6=8F=92=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
libs/Options.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'libs')
diff --git a/libs/Options.php b/libs/Options.php
index 04384c0..65cbcce 100644
--- a/libs/Options.php
+++ b/libs/Options.php
@@ -138,10 +138,10 @@ function themeConfig($form) {
'able' => _t('启用'),
'disable' => _t('停用'),
),
- 'able',
+ 'disable',
_t('是否启用 字数统计 功能'),
_t('
- 字数统计是一个基于WordsCounter插件统计全站字数的,默认启用
+ 字数统计是一个基于WordsCounter插件统计全站字数的
')
);
$form->addInput($EnableWordsCounter->addRule('required', _t('此处必须设置')));
--
cgit v1.2.3
From 6083c3a1ecffdd15be09ffebfd1f1266e00cb51e Mon Sep 17 00:00:00 2001
From: Kurococ Liu <21096362+KurococLiu@users.noreply.github.com>
Date: Tue, 1 Nov 2022 13:15:27 +0800
Subject: =?UTF-8?q?:bug:=20Fix:=20=E4=BF=AE=E6=AD=A3=E6=96=87=E6=A1=A3?=
=?UTF-8?q?=E5=8F=8A=E6=B3=A8=E9=87=8A=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
libs/Comments.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'libs')
diff --git a/libs/Comments.php b/libs/Comments.php
index c31dc7d..52a7c6a 100644
--- a/libs/Comments.php
+++ b/libs/Comments.php
@@ -36,7 +36,7 @@ Class Comments {
}
/**
- * 获取 Gravatar 头像链接
+ * 获取 Cravatar 头像链接
*/
public static function gravatar($email, int $size = 100, int $useCDN = NULL)
{
--
cgit v1.2.3