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

docs(helpers/open_graph): Fix incorrect default value and unintended rendering #2156

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

KentarouTakeda
Copy link
Contributor

Check List

  • Others (Update, fix, translation, etc...)
    • Languages:
    • en English
    • ru Russian
    • zh-cn simplified Chinese
    • zh-tw traditional Chinese
    • ja Japanese

Incorrect Default Value

The value blog specified as the default value for og:type is incorrect. As per the following implementation:

https://github.com/hexojs/hexo/blob/v7.1.1/lib/plugins/helper/open_graph.ts#L82

The default value is article or website depending on whether it is a post page or not.

Unintended Rendering

The default value of og:locale is chosen from several settings, as implemented below:

page.lang || page.language || config.language

Although this was written in the documentation, the | in this code was treated as a table separator, resulting in the display being cut off in the middle. I fixed it by escaping |.

Before fix:
before-fix

After fix:
after-fix

@github-actions github-actions bot added Docs source/docs zh lang: zh-cn && zh-tw en lang: en ko lang: ko pt-br lang: pt-br ru lang: ru th labg: th ja labels Mar 31, 2024
Copy link
Contributor

Theme name validation passed.
Theme thumbnails validation completed.

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

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

Thank you :)

@yoshinorin yoshinorin merged commit 842748c into hexojs:master Apr 3, 2024
6 checks passed
@KentarouTakeda KentarouTakeda deleted the fix-open-graph-helper branch April 6, 2024 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs source/docs en lang: en ja ko lang: ko pt-br lang: pt-br ru lang: ru th labg: th zh lang: zh-cn && zh-tw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants