Skip to content

Proposal: support for rel="alternate" hreflang="x" #27

@taringamberini

Description

@taringamberini

It would be nice if the generated translation_id would be used to generate alternate link in <head> section of a post.

Reason behind the proposal

Help search engines to serve the most appropriate (language) content.

Expected behaviour

Write an alternate_lang_link tag in the <head> section of a post layout:

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  {% alternate_lang_link %}
  ...

the tag should search all posts which shares the same translation_id and than for each post it should generate a list of strings for each language like:

<link rel="alternate" hreflang="<POST_LANG>" href="<POST_URL>" />

If an it, en, de, multilingual site had posts at URLs like:

the generated posts should all contains:

<!DOCTYPE html>
<head>
  <meta charset="utf-8">
  <link rel="alternate" hreflang="it" href="http://www.my-multilingual-site.com/it/blog/post-favoloso" />
  <link rel="alternate" hreflang="en" href="http://www.my-multilingual-site.com/en/blog/awsome-post" />
  <link rel="alternate" hreflang="de" href="http://www.my-multilingual-site.com/de/blog/geweldig-bericht" />
  ...

Thank you very much in advance for your help,
Tarin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions