Skip to content

Commit 26f386d

Browse files
committed
set og:locale according to Language
1 parent 5f008ec commit 26f386d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/macros/seo.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00" ) %}
77

8+
{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #}
9+
{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
10+
{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %}
11+
{%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%}
12+
813
{%- if is_404 -%}
914
<meta name="robots" content="noindex, follow" />
1015
{%- else -%}
@@ -117,7 +122,7 @@
117122

118123
{#- SEO MEDIA END #}
119124
<meta property="og:site_name" content="{{ config.title }}" />
120-
<meta property="og:locale" content="en_US" />
125+
<meta property="og:locale" content="{{ lang_locale }}" />
121126
<meta property="og:type" content="website" />
122127
{%- if page.updated %}
123128
<meta property="og:updated_time" content="{{ page.updated | date(format='%F') }}" />

0 commit comments

Comments
 (0)