Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render og:locale meta only when defined explicitly #388

Merged
merged 7 commits into from
Oct 8, 2020

Conversation

ashmaroli
Copy link
Member

Render og:locale meta attribute only if {{ page.locale }} has been defined.
This change is so that <html lang="{{ page.lang }}"> can be set to valid language (without territory) information.

Closes #375

@Sti2nd
Copy link

Sti2nd commented May 4, 2020

Nice, you're fast @ashmaroli ! 👏

lib/jekyll-seo-tag/drop.rb Outdated Show resolved Hide resolved
@shushugah
Copy link

Would this enable/allow a default locale in the _config.yml file? E.g in case of techworkersberlin.com, the default should be en_DE and occasionally on specific pages it's de_DE

@shushugah
Copy link

And tests need to be updated to remove <meta property="og:locale" content="en_US" /> in places where it's not explicitly set. The other option is to keep default of en_US but still use page_locale as the method/variable to set it.

@ashmaroli ashmaroli requested a review from DirtyF October 1, 2020 16:43
Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going from lang to locale looks like a breaking change

@ashmaroli
Copy link
Member Author

Yes, it is a change in behavior, but not exactly breaking.
locale setting takes preference over lang.

def page_locale
  (page["locale"] || site["locale"] || page["lang"] || site["lang"] || "en_US").tr("-", "_")
end

@DirtyF
Copy link
Member

DirtyF commented Oct 8, 2020

@jekyll: merge +minor

@jekyllbot jekyllbot merged commit 54beeaa into jekyll:master Oct 8, 2020
jekyllbot added a commit that referenced this pull request Oct 8, 2020
@ashmaroli ashmaroli deleted the page-og-locale branch October 8, 2020 14:49
@jekyll jekyll locked and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lang != locale
5 participants