feat: add global and per-post timezone support (#491)

* refactor: replace embedded svg with svg icon

* feat: add global and per-post timezone support

- add `SITE.timezone` in config to define a global default timezone.
- allow per-post timezone overrides via `timezone` in frontmatter.
- update date formatting logic to use the correct timezone when rendering timestamps.
- ensure that posts without a timezone fallback to `SITE.timezone`.
- improve consistency between local and deployed timezones.

* refactor: replace `LOCALE` constant with  `SITE.lang`

* docs: update guides

* fix: update code word-break inside markdown table

Closes #466
This commit is contained in:
Sat Naing
2025-03-22 17:21:21 +07:00
committed by GitHub
parent a397677d84
commit 5cff7c50b9
16 changed files with 70 additions and 86 deletions
+8
View File
@@ -23,6 +23,9 @@ importers:
astro:
specifier: ^5.5.2
version: 5.5.2(jiti@2.4.2)(lightningcss@1.29.2)(rollup@4.34.7)(typescript@5.8.2)(yaml@2.7.0)
dayjs:
specifier: ^1.11.13
version: 1.11.13
lodash.kebabcase:
specifier: ^4.1.1
version: 4.1.1
@@ -1170,6 +1173,9 @@ packages:
engines: {node: '>=4'}
hasBin: true
dayjs@1.11.13:
resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==}
debug@4.4.0:
resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==}
engines: {node: '>=6.0'}
@@ -3761,6 +3767,8 @@ snapshots:
cssesc@3.0.0: {}
dayjs@1.11.13: {}
debug@4.4.0:
dependencies:
ms: 2.1.3