hexojs / site

The website for Hexo. https://hexo.io/
https://hexo.io
MIT License
655 stars 1.29k forks source link

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

Closed KentarouTakeda closed 2 months ago

KentarouTakeda commented 3 months ago

Check List

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[bot] commented 3 months ago

Theme name validation passed. Theme thumbnails validation completed.