Multilingual mode: does the sitemaps uses hreflang?

I saw Use a sitemap to indicate alternate language pages a while ago and I was wondering if Hugo supported something like that to make search engines aware that it’s a multilingual site.

Not currently.

Any plans to implement a function like this? It would be neat.

On Jekyll I had implemented this, like:{% assign posts=site.posts | where:"ref", page.ref | sort: 'lang' %} {% for post in posts %} <link rel="alternate" hreflang="{{ post.lang }}" href="{{ site.url }}{{ post.url }}" /> {% endfor %}

But with proper Hugo syntax of course, is not possible to do that with right?

Not sure what the above does.

But creating links with hreflang from the translations is straight forward in Hugo.

1 Like