diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c97f891fb..de2c7d864 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -40,3 +40,22 @@ jobs: - name: Validate RSS feed run: xmllint --noout public/feed.xml # - run: npm run test:html5validate + - name: Lint for physical directional CSS classes + run: | + VIOLATIONS=$(grep -rn \ + -e '\bpl-\|\bpr-' \ + -e '\bml-\|\bmr-' \ + -e '\b-ml-\|\b-mr-' \ + -e '\bleft-\|\bright-' \ + -e '\btext-left\b\|\btext-right\b' \ + -e '\bborder-l\b\|\bborder-r\b' \ + -e '\bfloat-left\b\|\bfloat-right\b' \ + themes/le-2025/layouts/ themes/le-2025/assets/css/ \ + --include='*.html' --include='*.css' \ + | grep -v 'rtl:' \ + | grep -v 'direction: ltr' || true) + if [ -n "$VIOLATIONS" ]; then + echo "::error::Physical directional CSS classes found. Use logical equivalents (ps/pe, ms/me, start/end, text-start/text-end, border-s/border-e). See PR #2195." + echo "$VIOLATIONS" + exit 1 + fi diff --git a/config/_default/languages.he.toml b/config/_default/languages.he.toml index 2438918ec..187389e8a 100644 --- a/config/_default/languages.he.toml +++ b/config/_default/languages.he.toml @@ -3,6 +3,7 @@ contentDir = "content/he" languageName = "עברית" languageCode = "he" weight = 325 +languageDirection = "rtl" [params] beforeColon = "" diff --git a/i18n/am.toml b/i18n/am.toml index 3ef4af08e..6167182a4 100644 --- a/i18n/am.toml +++ b/i18n/am.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/ca.toml b/i18n/ca.toml index 8b54421b1..fda8a697c 100644 --- a/i18n/ca.toml +++ b/i18n/ca.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/cs.toml b/i18n/cs.toml index 690861d91..28dd66fe0 100644 --- a/i18n/cs.toml +++ b/i18n/cs.toml @@ -407,7 +407,13 @@ other = "Nezisková organizace poskytující bezplatné TLS certifikáty pro ví other = "Nezisková organizace poskytující bezplatné TLS certifikáty pro více než" [home_hero_certificate_count] -other = "700m" +other = "700" + +[abbreviation_million] +other = "m" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "webových stránek" diff --git a/i18n/da.toml b/i18n/da.toml index fa9eadacc..1ee16cec5 100644 --- a/i18n/da.toml +++ b/i18n/da.toml @@ -407,7 +407,13 @@ other = "En nonprofit, der leverer gratis TLS-certifikater til mere end ### hjem other = "En nonprofit, der leverer gratis TLS-certifikater til mere end" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/de.toml b/i18n/de.toml index df2846053..d250f35c4 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/el.toml b/i18n/el.toml index c7508fb1f..6139c4f39 100644 --- a/i18n/el.toml +++ b/i18n/el.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/en.toml b/i18n/en.toml index 5a1ed6aa3..652b568ab 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -413,7 +413,16 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "B" + +[certificate_count_format] +other = "[Number][Abbreviation]" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/es.toml b/i18n/es.toml index f8b7cabeb..a5dc4a05b 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/fa.toml b/i18n/fa.toml index 4935b996f..7fa657160 100644 --- a/i18n/fa.toml +++ b/i18n/fa.toml @@ -411,7 +411,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/fi.toml b/i18n/fi.toml index c69dc2b35..05060ecc6 100644 --- a/i18n/fi.toml +++ b/i18n/fi.toml @@ -407,7 +407,13 @@ other = "Voittoa tavoittelematon järjestö, joka tarjoaa ilmaisia TLS-var other = "Voittoa tavoittelematon järjestö, joka tarjoaa ilmaisia TLS-varmenteita yli" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "verkkosivustoille" diff --git a/i18n/fr.toml b/i18n/fr.toml index 9afa5f82f..c0ccc926a 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/he.toml b/i18n/he.toml index 4b9455052..9dd06c048 100644 --- a/i18n/he.toml +++ b/i18n/he.toml @@ -359,7 +359,7 @@ other = "דרגת זהב" other = "דרגת כסף" [common_read_more_arrow] -other = " →" +other = " ←" [newsletter_iframe_title] other = "טופס הרשמה לרשימת הדיוור" @@ -407,7 +407,16 @@ other = "ארגון ללא מטרות רווח שמספק אישורי TLS בח other = "ארגון ללא מטרות רווח שמספק אישורי TLS בחינם ליותר מ־" [home_hero_certificate_count] -other = "700 מיליון" +other = "700" + +[abbreviation_million] +other = "מיליון" + +[abbreviation_billion] +other = "" + +[certificate_count_format] +other = "[Number] [Abbreviation]" [home_hero_nonprofit_suffix] other = "אתרים" diff --git a/i18n/hr.toml b/i18n/hr.toml index a9102c4c9..a2f869453 100644 --- a/i18n/hr.toml +++ b/i18n/hr.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/hu.toml b/i18n/hu.toml index b64a31b6b..02ad536b4 100644 --- a/i18n/hu.toml +++ b/i18n/hu.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/id.toml b/i18n/id.toml index f35d5226b..294807f84 100644 --- a/i18n/id.toml +++ b/i18n/id.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/it.toml b/i18n/it.toml index 2637b99de..b2615656b 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/ja.toml b/i18n/ja.toml index 1ef893e45..3a2b0486f 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -407,7 +407,13 @@ other = "### 以上のウェブサイトに無料の TLS 証明書を提供し other = "私たちの非営利団体による無料 TLS 証明書の提供先:" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "ウェブサイト" diff --git a/i18n/kaa.toml b/i18n/kaa.toml index 0a9fd6ba3..638785b71 100644 --- a/i18n/kaa.toml +++ b/i18n/kaa.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/ko.toml b/i18n/ko.toml index 025dbe9b5..625677456 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -407,7 +407,13 @@ other = "###개 이상의 웹사이트에 무료 TLS 인증서를 제공하는 other = " " [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "개 이상의 웹사이트에 무료 TLS 인증서를 제공하는 비영리 단체" diff --git a/i18n/pl.toml b/i18n/pl.toml index 80064c054..5f9ec4387 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/pt-br.toml b/i18n/pt-br.toml index c0080cb75..7eff6be4a 100644 --- a/i18n/pt-br.toml +++ b/i18n/pt-br.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/ru.toml b/i18n/ru.toml index 9f87cc125..73431bcf3 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/si.toml b/i18n/si.toml index c4939fdbb..f7d51fdc7 100644 --- a/i18n/si.toml +++ b/i18n/si.toml @@ -407,7 +407,16 @@ other = "වියමන අඩවි ### කට වඩා නොමිලේ TL other = "නොමිලේ TLS සහතික සපයන ලාභ නොලබන සංවිධානයකි" [home_hero_certificate_count] -other = "දශලක්ෂ 700" +other = "700" + +[abbreviation_million] +other = "දශලක්ෂ" + +[abbreviation_billion] +other = "" + +[certificate_count_format] +other = "[Abbreviation] [Number]" [home_hero_nonprofit_suffix] other = "වියමන අඩවි" diff --git a/i18n/sr.toml b/i18n/sr.toml index b05a97ca9..fe79c30e5 100644 --- a/i18n/sr.toml +++ b/i18n/sr.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/sv.toml b/i18n/sv.toml index 418a3626f..45d8cb0e7 100644 --- a/i18n/sv.toml +++ b/i18n/sv.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "webbplatser" diff --git a/i18n/ta.toml b/i18n/ta.toml index d4094c036..cc3fefcad 100644 --- a/i18n/ta.toml +++ b/i18n/ta.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/th.toml b/i18n/th.toml index acb66291f..ce244b953 100644 --- a/i18n/th.toml +++ b/i18n/th.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/tr.toml b/i18n/tr.toml index 6d03eca58..b0316f8bf 100644 --- a/i18n/tr.toml +++ b/i18n/tr.toml @@ -407,7 +407,13 @@ other = "### 'dan fazla web sitesine ücretsiz TLS sertifikaları sağlayan kar other = "den fazla kuruluşa ücretsiz TLS sertifikaları sağlayan kar amacı gütmeyen bir kuruluş" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "web siteleri" diff --git a/i18n/uk.toml b/i18n/uk.toml index b760dd166..082ac16ed 100644 --- a/i18n/uk.toml +++ b/i18n/uk.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/uz.toml b/i18n/uz.toml index 9d05fe730..e5a98517b 100644 --- a/i18n/uz.toml +++ b/i18n/uz.toml @@ -407,7 +407,13 @@ other = "A nonprofit providing free TLS certificates to more than ### websites" other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/i18n/vi.toml b/i18n/vi.toml index 904dd97ff..82650fbf6 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -407,7 +407,13 @@ other = "Một tổ chức phi lợi nhuận cung cấp chứng chỉ TLS miễn other = "Một tổ chức phi lợi nhuận cung cấp chứng chỉ TLS miễn phí cho hơn" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "trang web" diff --git a/i18n/zh-cn.toml b/i18n/zh-cn.toml index e6ff0f8f5..d93bae88b 100644 --- a/i18n/zh-cn.toml +++ b/i18n/zh-cn.toml @@ -404,7 +404,16 @@ other = "为超过 ### 网站免费提供 TLS 证书的非营利证书颁发机 other = "为超过" [home_hero_certificate_count] -other = "7.0 亿" +other = "7.0" + +[abbreviation_million] +other = "亿" + +[abbreviation_billion] +other = "" + +[certificate_count_format] +other = "[Number] [Abbreviation]" [home_hero_nonprofit_suffix] other = "网站免费提供 TLS 证书的非营利证书颁发机构" diff --git a/i18n/zh-tw.toml b/i18n/zh-tw.toml index 131dc932b..f35a95f83 100644 --- a/i18n/zh-tw.toml +++ b/i18n/zh-tw.toml @@ -404,7 +404,13 @@ other = "為超過 ### 網站免費提供 TLS 證書的非營利證書頒發機 other = "A nonprofit providing free TLS certificates to more than" [home_hero_certificate_count] -other = "700M" +other = "700" + +[abbreviation_million] +other = "M" + +[abbreviation_billion] +other = "" [home_hero_nonprofit_suffix] other = "websites" diff --git a/themes/le-2025/assets/css/le-2025-theme-input.css b/themes/le-2025/assets/css/le-2025-theme-input.css index 26a6c37db..56d2a217c 100644 --- a/themes/le-2025/assets/css/le-2025-theme-input.css +++ b/themes/le-2025/assets/css/le-2025-theme-input.css @@ -101,7 +101,7 @@ } @utility donorbox-container { #donate-2025-page & iframe { - @apply md:ml-auto w-full; + @apply md:ms-auto w-full; } } @utility donate-2025-stat { @@ -140,7 +140,7 @@ } & td:not(:last-child) { - @apply border-r border-[#e8e8e8]; + @apply border-e border-[#e8e8e8]; } & tr:last-child td { @@ -227,11 +227,11 @@ } & ul { - @apply mb-6 pl-5; + @apply mb-6 ps-5; } & ol { - @apply mb-6 pl-5; + @apply mb-6 ps-5; } & ul { @@ -260,7 +260,7 @@ } & blockquote { - @apply pl-4 py-1 my-6 border-l-4 border-gray-300 text-gray-700 italic; + @apply ps-4 py-1 my-6 border-s-4 border-gray-300 text-gray-700 italic; } & h1 { @@ -313,15 +313,15 @@ } } @utility list-lock-icon { - @apply list-none pl-0!; + @apply list-none ps-0!; & li { - @apply relative pl-[53px] mb-7 list-none pt-2 min-h-[43px] font-semibold text-[20px] leading-[26px] tracking-[0.05em] text-le-blue; /* Add list-none to li */ + @apply relative ps-[53px] mb-7 list-none pt-2 min-h-[43px] font-semibold text-[20px] leading-[26px] tracking-[0.05em] text-le-blue; /* Add list-none to li */ } & li::before { content: ''; - @apply absolute left-0 top-1/2 transform -translate-y-1/2 w-[40px] h-[43px] bg-no-repeat bg-contain; + @apply absolute start-0 top-1/2 transform -translate-y-1/2 w-[40px] h-[43px] bg-no-repeat bg-contain; background-image: url('/images/le-logo-lockonly-black-cropped.svg'); } } @@ -333,7 +333,7 @@ @utility autoanchor { /* Autoanchor styles */ &a { - @apply no-underline text-gray-400! text-[0.8em] ml-2; + @apply no-underline text-gray-400! text-[0.8em] ms-2; } } @utility boxed { @@ -384,7 +384,7 @@ @apply py-16 bg-le-blue text-white; } @utility post-hero__inner { - @apply narrow-container mx-auto text-left pb-0.5; + @apply narrow-container mx-auto text-start pb-0.5; } @utility post-hero__breadcrumb { @apply text-sm; @@ -405,7 +405,7 @@ @apply w-full mb-6; @media (width >= theme(--breakpoint-md)) { - @apply float-right max-w-[33.33333%] ml-[25px] flex-[0_0_33.33333%]; + @apply float-right rtl:float-left max-w-[33.33333%] ms-[25px] flex-[0_0_33.33333%]; } } @utility pic-quote-right__caption { @@ -538,7 +538,7 @@ } table th, table td { - @apply px-[15px] py-3 text-left border-b border-[#e8e8e8]; + @apply px-[15px] py-3 text-start border-b border-[#e8e8e8]; } /* Mobile Navigation */ @@ -576,7 +576,7 @@ } dfn { font-weight: bold; - padding-right: .25em; /* Prevent italics text from hitting the ":" */ + padding-inline-end: .25em; /* Prevent italics text from hitting the ":" */ } /* Hide Netlify preview bar */ @@ -591,7 +591,7 @@ } .hero-bg { - @apply absolute top-0 left-0 w-full h-full bg-cover opacity-85 z-0; + @apply absolute top-0 start-0 w-full h-full bg-cover opacity-85 z-0; background-image: url('/images/radiant_london_resized/radiant_london_5_480w.jpg'); background-position: top left; } @@ -653,7 +653,7 @@ } .pull-quote-right { - @apply float-right md:ml-[25px] w-full md:max-w-[33.33333%] md:flex-[0_0_33.33333%]; + @apply float-right rtl:float-left md:ms-[25px] w-full md:max-w-[33.33333%] md:flex-[0_0_33.33333%]; } .pull-quote-right .quote-text-value { @@ -668,5 +668,5 @@ } .prose-content .pull-quote-right blockquote { - @apply mt-0 pt-0 border-0 pl-0; + @apply mt-0 pt-0 border-0 ps-0; } diff --git a/themes/le-2025/assets/js/number-animation.js b/themes/le-2025/assets/js/number-animation.js index 59971aa6b..94645ef8f 100644 --- a/themes/le-2025/assets/js/number-animation.js +++ b/themes/le-2025/assets/js/number-animation.js @@ -2,10 +2,23 @@ document.addEventListener("DOMContentLoaded", function() { const countElement = document.getElementById("certificate-count"); if (!countElement) return; - const finalNumber = 700; + const countStr = (countElement.dataset.count || "").trim(); + const abbr = countElement.dataset.abbr || "M"; + const fmt = countElement.dataset.format || "[Number][Abbreviation]"; + + if (!/^[\d.]+$/.test(countStr)) return; + + const finalNumber = parseFloat(countStr); + const decimalPlaces = countStr.includes('.') + ? (countStr.split('.')[1] || '').length : 0; const duration = 1000; - countElement.textContent = "0M"; + function formatCount(n) { + var num = decimalPlaces > 0 ? n.toFixed(decimalPlaces) : Math.round(n).toString(); + return fmt.replace("[Number]", num).replace("[Abbreviation]", abbr); + } + + countElement.textContent = formatCount(0); setTimeout(() => { const startTime = performance.now(); @@ -13,10 +26,8 @@ document.addEventListener("DOMContentLoaded", function() { function updateCount(currentTime) { const elapsed = currentTime - startTime; const progress = Math.min(elapsed / duration, 1); - const easeIn = t => t * t; - const easedProgress = easeIn(progress); - const currentNumber = Math.round(easedProgress * finalNumber); - countElement.textContent = currentNumber + "M"; + const easedProgress = progress * progress; + countElement.textContent = formatCount(easedProgress * finalNumber); if (progress < 1) { requestAnimationFrame(updateCount); diff --git a/themes/le-2025/layouts/_default/single.html b/themes/le-2025/layouts/_default/single.html index bd22c61ad..2527606fd 100644 --- a/themes/le-2025/layouts/_default/single.html +++ b/themes/le-2025/layouts/_default/single.html @@ -41,7 +41,7 @@ {{ end }} {{ if not $currentPage.Lastmod.IsZero }} - {{ $heroParams = merge $heroParams (dict "lastUpdated" ($currentPage.Lastmod.Format "January 2, 2006") "section" $currentPage.Section) }} + {{ $heroParams = merge $heroParams (dict "lastUpdated" ($currentPage.Lastmod | time.Format ":date_long") "section" $currentPage.Section) }} {{ end }} {{ if eq $currentPage.Params.imageHero true }} @@ -53,7 +53,7 @@ {{ if and .Params.english_is_canonical (ne .Language.Lang "en") }}