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

@@ -19,28 +19,13 @@ Head to this [documentation](https://github.com/Sped0n/bridget/blob/main/doc/get
## Features ## Features
- **Blazingly fast**: 100/100 on both desktop and mobile in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights) - **Blazingly fast**: 100/100 on both desktop and mobile in [Google PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights)
- Powered by **[Solid.js](https://www.solidjs.com)**, a declarative, efficient, and flexible JavaScript library for building user interfaces - Powered by **[SolidJS](https://www.solidjs.com)**, a declarative, efficient, and flexible JavaScript library for building user interfaces
- JS **dynamic loading** (powered by ESM) - JS **dynamic loading**
- Image **Preloading**/**Lazy loading** - Image **preloading** + **lazy loading**
- **Dynamic resolution** based on view mode - **Dynamic resolution** based on view mode
- Multiple **analytics** services supported - Multiple **analytics** services supported
- Search engine **verification** supported (Google, Bind, Yandex and Baidu) - Search engine **verification** supported (Google, Bind, Yandex and Baidu)
## Multilingual and i18n
Bridget supports the following languages:
- English
- Simplified Chinese
- Traditional Chinese
- Japanese
- Korean
- Deutsch
- Spanish
- Italian
- Tamil
- [Contribute with a new language](https://github.com/Sped0n/bridget/pulls)
## Credits ## Credits
- https://github.com/tylermcrobert/bridget-pictures-www - https://github.com/tylermcrobert/bridget-pictures-www

View File

@@ -7,59 +7,3 @@
font-style: normal; font-style: normal;
font-display: swap; font-display: swap;
} }
@font-face {
font-family: 'Noto Sans CJK SC';
src: url('/lib/fonts/NotoSansCJKsc-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Noto Sans CJK TC';
src: url('/lib/fonts/NotoSansCJKtc-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Noto Sans CJK JP';
src: url('/lib/fonts/NotoSansCJKjp-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Noto Sans CJK KR';
src: url('/lib/fonts/NotoSansCJKkr-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Noto Sans';
src: url('/lib/fonts/NotoSans-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'FW';
src: url('/lib/fonts/fw.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Noto Sans';
src: url('/lib/fonts/NotoSansTamil-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}

View File

@@ -3,10 +3,10 @@
body { body {
line-height: 1.2; line-height: 1.2;
font-size: 16px; font-size: 16px;
font-family: sans-serif; font-family: 'Geist', sans-serif;
button { button {
font-family: 'FW'; font-family: 'FW', sans-serif;
} }
@include min-width('tablet') { @include min-width('tablet') {
@@ -16,51 +16,3 @@ body {
font-size: 19px; font-size: 19px;
} }
} }
body:lang(en) {
font-family: 'Geist', sans-serif;
}
body:lang(de) {
font-family: 'Geist', sans-serif;
}
body:lang(es) {
font-family: 'Geist', sans-serif;
}
body:lang(fr) {
font-family: 'Geist', sans-serif;
}
body:lang(it) {
font-family: 'Geist', sans-serif;
}
body:lang(zh-cn) {
font-family: 'Noto Sans', 'Noto Sans CJK SC', sans-serif;
}
body:lang(zh-sg) {
font-family: 'Noto Sans', 'Noto Sans CJK SC', sans-serif;
}
body:lang(zh-hk) {
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
}
body:lang(zh-mo) {
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
}
body:lang(zh-tw) {
font-family: 'Noto Sans', 'Noto Sans CJK TC', sans-serif;
}
body:lang(ja) {
font-family: 'Noto Sans', 'Noto Sans CJK JP', sans-serif;
}
body:lang(ko) {
font-family: 'Noto Sans', 'Noto Sans CJK KR', sans-serif;
}

View File

@@ -8,18 +8,6 @@ title = 'Bridget'
disableKinds = ["section", "taxonomy", "term", "home"] disableKinds = ["section", "taxonomy", "term", "home"]
# robots.txt # robots.txt
enableRobotsTXT = true enableRobotsTXT = true
# available options
# * en (powered by Geist)
# * de (powered by Geist)
# * es (powered by Geist)
# * fr (powered by Geist)
# * it (powered by Geist)
# * zh-sg zh-cn (powered by Noto Sans SC)
# * zh-hk zh-tw zh-mo (powered by Noto Sans TC)
# * ja (powered by Noto Sans JP)
# * ko (powered by Noto Sans KR)
# * ta (powered by Noto Sans TA)
defaultContentLanguage = 'en'
# theme as module # theme as module
[module] [module]

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 */}} {{/* critical style */}}
{{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}} {{- $style := dict "Source" "scss/critical.scss" "Fingerprint" $fingerprint -}}
{{- $options := dict "enableSourceMap" true "includePaths" (slice "node_modules") "transpiler" "dartsass" -}} {{- $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 -}} {{- partial "plugin/style.html" $style -}}
{{- $style := dict "Link" "/bundled/css/main.css" "Defer" true -}} {{- $style := dict "Link" "/bundled/css/main.css" "Defer" true -}}
@@ -26,46 +26,4 @@
{{/* fonts */}} {{/* fonts */}}
<link rel="preload" href="/lib/fonts/fw.woff2" as="font" crossorigin /> <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 />
<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 -}}

View File

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

View File

@@ -6,9 +6,9 @@ license = "MIT"
licenselink = "https://github.com/Sped0n/bridget/blob/main/LICENSE" licenselink = "https://github.com/Sped0n/bridget/blob/main/LICENSE"
description = "Bridget is a minimal Hugo theme designed for photographers/visual artists." description = "Bridget is a minimal Hugo theme designed for photographers/visual artists."
homepage = "https://github.com/Sped0n/bridget" homepage = "https://github.com/Sped0n/bridget"
demosite = "https://bridget-demo.sped0nwen.com" demosite = "https://bridget-demo.sped0n.com"
tags = ["gallery", "minimal", "portfolio", "responsive"] tags = ["gallery", "minimal", "portfolio", "responsive"]
features = ["SEO optimized", "TypeScript", "multi-language support"] features = ["SEO optimized", "TypeScript"]
[author] [author]
name = "sped0n" name = "sped0n"