From 1383cc5caa7a4b2ebc0da4eeb94046538ff8813f Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 1 Nov 2025 09:29:22 +0800 Subject: perf: remove Google Fonts --- assets/css/utils/_variables.scss | 15 ++++++++++----- content/_drafts/53.md | 21 ++++++++++++++++++++- layouts/_partials/head/css.html | 9 --------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/assets/css/utils/_variables.scss b/assets/css/utils/_variables.scss index 1d70cd7a..0bea0c5d 100644 --- a/assets/css/utils/_variables.scss +++ b/assets/css/utils/_variables.scss @@ -10,7 +10,16 @@ --bright-background-color: #fafafa; /* fonts */ - --serif-font-family: "Noto Serif", "Noto Serif SC", serif; + --serif-font-family: + "Noto Serif", + "Noto Serif SC", + "Noto Serif TC", + "Source Han Serif SC", + "Source Han Serif TC", + "Songti SC", + "Times New Roman", + Times, + serif; --page-width: 650px; --page-margin-y: 5rem; @@ -23,10 +32,6 @@ --pagefind-ui-tag: var(--border-color); } -html[lang="en-US"] { - --serif-font-family: "Playfair Display", serif; -} - @mixin variablesInDarkMode { --background-color: #1d2021; --block-background-color: rgb(var(--block-background-color-rgb)); diff --git a/content/_drafts/53.md b/content/_drafts/53.md index c6b12652..31a86504 100644 --- a/content/_drafts/53.md +++ b/content/_drafts/53.md @@ -61,6 +61,25 @@ toc: true ## ↯ · 当下 +### 博客的改动 + +1. 移除了 Google Fonts。透过 PageSpeed Insight 发现网站有一大半的性能问题都是引用了外部字体导致的。如果想要更好的阅读体验,可以手动在电脑上安装 [Noto Serif](https://fonts.google.com/noto/specimen/Noto+Serif) 和 [Noto Serif SC](https://fonts.google.com/noto/specimen/Noto+Serif+SC?query=Noto+serif+SC) 字体。 + + 现在添加了更多的回落字体(fallback),具体代码如下。 + + ```css + --serif-font-family: + "Noto Serif", + "Noto Serif SC", + "Noto Serif TC", + "Source Han Serif SC", + "Source Han Serif TC", + "Songti SC", + "Times New Roman", + Times, + serif; + ``` + ### 看《地狱客栈》第二季 -### 观影《即兴谋杀》 \ No newline at end of file +### 观影《即兴谋杀》 diff --git a/layouts/_partials/head/css.html b/layouts/_partials/head/css.html index 250ef4a3..f7fa9a9c 100644 --- a/layouts/_partials/head/css.html +++ b/layouts/_partials/head/css.html @@ -1,12 +1,3 @@ - - - -{{ if eq .Site.Language.Lang "zh" }} - -{{ else }} - -{{ end }} - {{ with resources.Get "css/aplayer.css" }} -- cgit v1.2.3