feat(link.html): update font preload links to use appropriate font files based on language code for improved font rendering

This commit is contained in:
Sped0n
2023-11-03 10:09:24 +08:00
parent 10efa941f2
commit 339a78364a

View File

@@ -25,14 +25,38 @@
{{- end -}}
{{/* main js */}}
<script type="module" src="bundled/js/main.js" defer></script>
<script type="module" src="/bundled/js/main.js" defer></script>
{{/* fonts */}}
<link
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
{{- if (partial "function/langCode.html" (slice "en")) -}}
<link rel="preload" href="/lib/fonts/GeistVF.woff2" as="font" crossorigin />
{{- else if (partial "function/langCode.html" (slice "zh-cn" "zh-sg")) -}}
<link
rel="preload"
href="/lib/fonts/GeistVF.woff2"
href="/lib/fonts/NotoSansCJKsc-Regular.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link rel="preload" href="/lib/fonts/fw.svg" as="font" type="font/svg" crossorigin />
/>
{{- else if (partial "function/langCode.html" (slice "zh-tw" "zh-hk" "zh-mo")) -}}
<link
rel="preload"
href="/lib/fonts/NotoSansCJKtc-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "ja")) -}}
<link
rel="preload"
href="/lib/fonts/NotoSansCJKjp-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "ko")) -}}
<link
rel="preload"
href="/lib/fonts/NotoSansCJKkr-Regular.woff2"
as="font"
crossorigin
/>
{{- end -}}