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

Add support for og:image:alt #15

Merged
merged 4 commits into from
Jul 20, 2020
Merged

Add support for og:image:alt #15

merged 4 commits into from
Jul 20, 2020

Conversation

tcmetzger
Copy link
Contributor

This pull request adds support for og:image:alt (partially solves #10).

This is how the alt tag is generated:

  • ogp_image_alt is a new option for conf.py. Any string provided with this option will be used as alt text
  • If no string is provided, opengraph.py will try to automatically use site_name as alt text. If site_name is not available, htp.text will be used instead.
  • The user also has the option to completely turn off alt text, by setting ogp_image_alt to False.

This pull request also includes an additional test and an update to README.md.

According to opg.me any page that includes an og:image should also inclode an og:image:alt. This would not only increase compliance with opg but might also increase search engine visibility.

sphinxext/opengraph.py Outdated Show resolved Hide resolved
Co-authored-by: Vasista Vovveti <vasistavovveti@gmail.com>
README.md Outdated Show resolved Hide resolved
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.

3 participants