aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/index
diff options
context:
space:
mode:
Diffstat (limited to 'v2/src/bin/index')
-rwxr-xr-xv2/src/bin/index12
1 files changed, 10 insertions, 2 deletions
diff --git a/v2/src/bin/index b/v2/src/bin/index
index 553cc27..36abd2e 100755
--- a/v2/src/bin/index
+++ b/v2/src/bin/index
@@ -85,7 +85,15 @@ index_category_title_html="$(eval "echo \"\$index_category_${collection}_title\"
export url_absolute feed_url by_category_url title_html index_recent_title_html \
index_category_title_html
-translations_html="$(cat <<-EOF
+translations_head_html="$(langs |
+ awk -v lang="${lang:?}" -v coll="$collection" '$0 != lang {
+ "coll2path " $0 " " coll | getline coll_path
+ "url-for " $0 "/" coll_path | getline url
+ printf " <link rel=\"alternate\" type=\"text/html\" href=\"%s\" hreflang=\"%s\" />\n",
+ url, $0
+ }'
+)"
+translations_body_html="$(cat <<-EOF
<ul class="translation-list">
$(langs | awk -v coll="$collection" '{
"coll2path " $0 " " coll | getline coll_path
@@ -95,7 +103,7 @@ translations_html="$(cat <<-EOF
</ul>
EOF
)"
-export translations_html
+export translations_head_html translations_body_html