Skip to content

Commit 48235ca

Browse files
committed
added hreflang
1 parent 3bc624e commit 48235ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/_layouts/post.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ bodyClass: single single-post
106106
{% set hasUrlInLang = (post.url | locale_links | hasUrlInLang(lang)) %}
107107
{% if (post.data.lang == lang) or not hasUrlInLang %}
108108
<li class="otherposts__item">
109-
<a href="{{post.page.url}}" class="otherposts__link">
109+
<a href="{{post.page.url}}" class="otherposts__link" hreflang="{{ post.data.lang }}">
110110
<img class="otherposts__flag" src="/assets/images/{{ post.data.lang | upper }}.png" alt="flag" />
111111
&middot;
112112
<time class="otherposts__date" datetime="{{ post.date | dateToISO }}" aria-label=", written {{ post.date | readableDate('dd LLL yyyy', locale) }}">

src/_layouts/posts.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bodyClass: page page-id-posts
1919
{% if (post.data.lang == lang) or not hasUrlInLang %}
2020
<li class="postlist__item">
2121
<img class="postlist__flag" src="/assets/images/{{ post.data.lang | upper }}.png" alt="flag" />
22-
<h2 class="postlist_title"><a href="{{ post.page.url | locale_url | relative(page) }}">{{post.data.title}}</a></h2>
22+
<h2 class="postlist_title"><a href="{{ post.page.url | locale_url | relative(page) }}" hreflang="{{ post.data.lang }}">{{post.data.title}}</a></h2>
2323
<div class="postlist__meta">
2424
<time class="postlist__date" datetime="{{ post.data.date | dateToISO }}">{{ post.data.date | readableDate('dd LLL yyyy', locale) }}</time>
2525
{% if post.data.tags %}

0 commit comments

Comments
 (0)