diff options
| author | Eltrac <hi@guhub.cn> | 2025-05-11 09:48:28 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-05-11 09:48:28 +0800 |
| commit | 0c5534c70955f33522d862c839601adce5a17ae3 (patch) | |
| tree | 5b3af1d684bf22359fee5a9a595a1d68f3044618 | |
| parent | de62f5eea01b4447f4d6ada3a3a266b4e8916a76 (diff) | |
perf: load only web font needed for certain language
Former-commit-id: 08843f4f636d557960da0ebc9087e729bca9db69
| -rw-r--r-- | layouts/partials/head/css.html | 6 |
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 -}} |
