diff --git a/docs-overrides/assets/stylesheets/components/_lang-switch.scss b/docs-overrides/assets/stylesheets/components/_lang-switch.scss new file mode 100644 index 00000000000..df515fa9c83 --- /dev/null +++ b/docs-overrides/assets/stylesheets/components/_lang-switch.scss @@ -0,0 +1,50 @@ +.sd-lang-switch { + display: inline-flex; + align-items: stretch; + margin: 0 0.4rem; + padding: 2px; + border: 1px solid rgba(255, 255, 255, 0.45); + border-radius: 999px; + background: rgba(255, 255, 255, 0.08); + font-size: 0.72rem; + line-height: 1; + + &__item { + display: inline-flex; + align-items: center; + padding: 0.28rem 0.7rem; + color: rgba(255, 255, 255, 0.85); + text-decoration: none; + border-radius: 999px; + font-weight: 600; + letter-spacing: 0.02em; + transition: background-color 120ms ease, color 120ms ease; + + &:hover, + &:focus { + color: #ffffff; + background-color: rgba(255, 255, 255, 0.18); + } + + &--active { + color: #ca463a; + background-color: #ffffff; + + &:hover, + &:focus { + color: #ca463a; + background-color: #ffffff; + } + } + } +} + +@media (max-width: 600px) { + .sd-lang-switch { + font-size: 0.68rem; + + &__item { + padding: 0.22rem 0.55rem; + } + } +} diff --git a/docs-overrides/assets/stylesheets/extra.scss b/docs-overrides/assets/stylesheets/extra.scss index 632f78effe5..ff3d71722bc 100644 --- a/docs-overrides/assets/stylesheets/extra.scss +++ b/docs-overrides/assets/stylesheets/extra.scss @@ -13,6 +13,7 @@ @import "components/footer"; @import "components/sidebar"; @import "components/search-tags"; +@import "components/lang-switch"; // Pages @import "pages/page-home"; diff --git a/docs-overrides/main.html b/docs-overrides/main.html index 652d9c4d85d..1098300f0bc 100644 --- a/docs-overrides/main.html +++ b/docs-overrides/main.html @@ -1,9 +1,17 @@ {% extends "base.html" %} +{# Locale shared across all blocks below. Detected once via mkdocs-static-i18n's + reconfigure_material flag, which sets config.theme.language per build. #} +{%- set cur_lang = config.theme.language if config.theme.language in ['en', 'zh'] else 'en' -%} + {% block outdated %} -You're not viewing the latest stable version. +{%- set outdated_msg = { + 'en': ['You\'re not viewing the latest stable version.', 'Click here to go to the latest stable version.'], + 'zh': ['您当前查看的不是最新稳定版本。', '点击此处跳转到最新稳定版本。'] +} -%} +{{ outdated_msg[cur_lang][0] }} - Click here to go to the latest stable version. + {{ outdated_msg[cur_lang][1] }} {% endblock %} @@ -20,14 +28,146 @@ {% endblock %} {% block header %} + {%- set announcement = { + 'en': 'Apache Sedona 1.9.0 is out now, featuring Spark 4.1 support, proj4sedona CRS transformation, Bing Tile functions, and more!', + 'zh': 'Apache Sedona 1.9.0 已正式发布,新增 Spark 4.1 支持、proj4sedona 坐标系转换、Bing Tile 函数等众多特性!' + } -%}
GPS points
-buildings
-parcels
-trips
-places
-businesses
-land
-vegetation
-rasters
-vectors
-tabular tables
+{{ t.typed_gps }}
+{{ t.typed_buildings }}
+{{ t.typed_parcels }}
+{{ t.typed_trips }}
+{{ t.typed_places }}
+{{ t.typed_businesses }}
+{{ t.typed_land }}
+{{ t.typed_vegetation }}
+{{ t.typed_rasters }}
+{{ t.typed_vectors }}
+{{ t.typed_tabular }}