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

include og:locale #2630

Merged
merged 2 commits into from Jul 4, 2017
Merged

include og:locale #2630

merged 2 commits into from Jul 4, 2017

Conversation

tilsammans
Copy link
Contributor

This OpenGraph property is optional, but generally recommended. Since Hexo has i18n it's easy to support and will provide extra detail.

The og:locale property content will be set according to: (in order)

  1. the language option to the open graph helper;
  2. the page lang/language;
  3. the site config.

When no language is set anywhere, the og:locale attribute is not set. In that case, the OpenGraph specification uses en_US as default.

<meta property="og:locale" content="zh-tw">
  • Added test cases for the changes.
  • Passed the CI test.

The og:locale attribute will be set according to the options, the page language or finally the site config. When no language is set anywhere, the og:locale attribute is not set.
@coveralls
Copy link

coveralls commented Jun 30, 2017

Coverage Status

Coverage increased (+0.002%) to 97.146% when pulling 8f4c220 on scrollytelling:open_graph_locale into 5a28258 on hexojs:master.

@coveralls
Copy link

coveralls commented Jun 30, 2017

Coverage Status

Coverage increased (+0.002%) to 97.146% when pulling 08a570e on scrollytelling:open_graph_locale into 5a28258 on hexojs:master.

Copy link
Member

@NoahDragon NoahDragon left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution.

@NoahDragon NoahDragon merged commit 3ee44f4 into hexojs:master Jul 4, 2017
@tilsammans tilsammans deleted the open_graph_locale branch July 5, 2017 09:05
@tilsammans
Copy link
Contributor Author

🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants