summaryrefslogtreecommitdiff
path: root/layouts/partials/head/css.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-05-11 09:48:28 +0800
committerEltrac <hi@guhub.cn>2025-05-11 09:48:28 +0800
commit08843f4f636d557960da0ebc9087e729bca9db69 (patch)
tree8a93ec11593334c7f092caf5a92dfed255817376 /layouts/partials/head/css.html
parentbe78961df11cafc6cbc3133c15da3a4da9ded7bd (diff)
perf: load only web font needed for certain language
Diffstat (limited to 'layouts/partials/head/css.html')
-rw-r--r--layouts/partials/head/css.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html
index 6777e5ad..6b8daefd 100644
--- a/layouts/partials/head/css.html
+++ b/layouts/partials/head/css.html
@@ -1,7 +1,11 @@
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
-<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
+{{ if eq .Site.Language.Lang "zh" }}
+<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
+{{ else }}
+<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap" rel="stylesheet">
+{{ end }}
<!-- Extra -->
{{ range .Site.Params.extraCSSFiles -}}