jekyll/jekyll-seo-tag

lang != locale

fiskhandlarn opened this issue · 4 comments

From https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md:

  • lang - The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US.

Whatever lang is set to seems to be used both for the lang attribute in the html tag as well as for the og:locale property.
HTML's lang should adhere to ISO 639-1 (that is, language only) but og:locale should be on the language_TERRITORY format.

Suggestion: Add locale config setting and use that for og:locale. Use lang setting only for HTML's lang.

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

I can reproduce this in version 2.6.1.

Steps to reproduce:

  1. In the front matter of a page/post add language like this: lang: en_GB
  2. Generate site
  3. Find the generated html and look at the html tag. For me it looks like this:
<html lang="en_GB">

This is a bug because, as the original comment says, the lang attribute on the html tag takes another language code and should look like this:

<html lang="en">

Other information:

When one don't specify the lang variable en_US is the default, but interestingly enough it correctly sets the lang attribute to be "en".

I am using this plugin through Github Pages.

The common issue in both of the comments above is that <html lang="en_GB"> is incorrect.
While that is true, it doesn't concern this plugin because this plugin doesn't render the <html /> tag, only stuff in the <head /> tag.

While we shall look into resolving the issue with the og:locale property, @Sti2nd You may need to open a ticket with the Minima theme repository regarding the <html/> tag because it comes from your theme.

Thank you @ashmaroli , created an issue in the Minima repo.