From 847258f60c60d6bac89df831c9933269cdd1dd8c Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Fri, 15 Jul 2022 15:15:02 -0500 Subject: [PATCH] All for i18n pages --- _includes/layouts/base.njk | 8 +++++++- _includes/layouts/post.njk | 9 +++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index 58f4bcc..8080fbd 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -15,7 +15,13 @@ - {# TODO add link rel="alternate" for langs #} + {%- set alternateUrls = page.url | locale_links %} + {% if alternateUrls.length %} + + {%- for link in alternateUrls %} + + {%- endfor %} + {%- endif %}
diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 34d0887..81c4f46 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -18,10 +18,11 @@ templateClass: tmpl-post {% if i18nLinks.length %} {% endif %}