diff --git a/_includes/head.html b/_includes/head.html
index 4b16114a..b4ce6f0c 100644
--- a/_includes/head.html
+++ b/_includes/head.html
@@ -6,5 +6,5 @@
{%- feed_meta -%}
- {% include hreflangs.html %}
+ {%- include hreflangs.html -%}
diff --git a/_includes/hreflangs.html b/_includes/hreflangs.html
index 6ee7a615..d4bc9055 100644
--- a/_includes/hreflangs.html
+++ b/_includes/hreflangs.html
@@ -1,33 +1,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+{% for translation in site.translations %}
+ {%- assign locale_tuple = translation.locale | split: "_" -%}
+ {%- assign lang = locale_tuple | first -%}
+ {%- assign region = locale_tuple | last -%}
+ {%- assign filename_prefix = 'index-' -%}
+ {%- assign filename_suffix = '.html' -%}
+ {%- if lang == 'zh' -%}
+ {%- if region == 'TW' -%}
+ {%- assign hreflang = 'zh-Hant' -%}
+ {%- assign downcase_hreflang = 'zh-Hant' | downcase -%}
+
+ {%- else -%}
+ {%- assign hreflang = 'zh-Hans' -%}
+ {%- assign downcase_hreflang = 'zh-Hans' | downcase -%}
+
+ {%- endif -%}
+ {%- elsif lang == 'pt' -%}
+ {%- assign downcase_region = region | downcase -%}
+
+ {%- elsif lang == 'gal' -%}
+ {%- assign lang = gl -%}
+
+ {%- else -%}
+
+ {%- endif -%}
+{%- endfor -%}
+
diff --git a/_translations/index_gr.md b/_translations/index_el.md
similarity index 100%
rename from _translations/index_gr.md
rename to _translations/index_el.md
diff --git a/_translations/index_gal.md b/_translations/index_gl.md
similarity index 100%
rename from _translations/index_gal.md
rename to _translations/index_gl.md
diff --git a/_translations/index_jp.md b/_translations/index_ja.md
similarity index 100%
rename from _translations/index_jp.md
rename to _translations/index_ja.md
diff --git a/_translations/index_al.md b/_translations/index_sq.md
similarity index 100%
rename from _translations/index_al.md
rename to _translations/index_sq.md
diff --git a/_translations/index_rs.md b/_translations/index_sr.md
similarity index 100%
rename from _translations/index_rs.md
rename to _translations/index_sr.md
diff --git a/_translations/index_se.md b/_translations/index_sv.md
similarity index 100%
rename from _translations/index_se.md
rename to _translations/index_sv.md
diff --git a/_translations/index_ua.md b/_translations/index_uk.md
similarity index 100%
rename from _translations/index_ua.md
rename to _translations/index_uk.md
diff --git a/_translations/index_zh_cn.md b/_translations/index_zh_hans.md
similarity index 100%
rename from _translations/index_zh_cn.md
rename to _translations/index_zh_hans.md
diff --git a/_translations/index_zh_tw.md b/_translations/index_zh_hant.md
similarity index 98%
rename from _translations/index_zh_tw.md
rename to _translations/index_zh_hant.md
index dea21eac..d2adf0fb 100644
--- a/_translations/index_zh_tw.md
+++ b/_translations/index_zh_hant.md
@@ -2,7 +2,7 @@
layout: signed
title: 一封支持 Richard Stallman 的公開信
description: An open letter in support of Richard Matthew Stallman being reinstated by the Free Software Foundation
-image: /assets/social-media-preview.png
+aimage: /assets/social-media-preview.png
locale: zh_TW
twitter:
card: summary_large_image