refactor: remove multilingual support and language-specific fonts

Simplify to Geist font family for all languages. Update README, SCSS,
partials, and config. Fix style template execution order.

Signed-off-by: Sped0n <hi@sped0n.com>
This commit is contained in:
Sped0n
2025-11-12 00:02:47 +08:00
committed by Ryan
parent 6b2c1de9d8
commit 72b830def9
14 changed files with 12 additions and 194 deletions

View File

@@ -1,9 +0,0 @@
{{- $res := false -}}
{{- range . -}}
{{- if eq site.LanguageCode . -}}
{{- $res = true -}}
{{- end -}}
{{- end -}}
{{- return $res -}}

View File

@@ -4,7 +4,7 @@
{{/* critical style */}}
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}}
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") "transpiler" "dartsass" -}}
{{- $style = dict "Context" . "ToCSS" $options "Inline" true | merge $style -}}
{{- $style = dict "Context" . "ToCSS" $options "Inline" true "Template" true | merge $style -}}
{{- partial "plugin/style.html" $style -}}
{{- $style := dict "Link" "/bundled/css/main.css" "Defer" true -}}
@@ -26,46 +26,4 @@
{{/* fonts */}}
<link rel="preload" href="/lib/fonts/fw.woff2" as="font" crossorigin />
{{- if (partial "function/langCode.html" (slice "en" "de" "fr" "es" "it")) -}}
<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/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKsc-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "zh-tw" "zh-hk" "zh-mo")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<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/NotoSans-Regular.woff2" as="font" crossorigin />
<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/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansCJKkr-Regular.woff2"
as="font"
crossorigin
/>
{{- else if (partial "function/langCode.html" (slice "ta")) -}}
<link rel="preload" href="/lib/fonts/NotoSans-Regular.woff2" as="font" crossorigin />
<link
rel="preload"
href="/lib/fonts/NotoSansTamil-Regular.woff2"
as="font"
crossorigin
/>
{{- end -}}
<link rel="preload" href="/lib/fonts/GeistVF.woff2" as="font" crossorigin />

View File

@@ -11,13 +11,13 @@
{{- $resource = resources.FromString $.Path . -}}
{{- end -}}
{{- if $resource -}}
{{- with .Template -}}
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
{{- end -}}
{{- with .ToCSS -}}
{{- $options := . | merge (dict "outputStyle" "compressed") -}}
{{- $resource = $resource | toCSS $options -}}
{{- end -}}
{{- with .Template -}}
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
{{- end -}}
{{- if or .Minify .Inline -}}
{{- $resource = $resource | minify -}}
{{- end -}}