Docs: generate social media cards per page#129120
Docs: generate social media cards per page#129120hugovk wants to merge 3 commits intopython:mainfrom
Conversation
|
Here's the docs for the social cards: https://sphinxext-opengraph.readthedocs.io/en/latest/socialcards.html This generates a It removes HTML from the page head like: <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
<meta property="og:image:alt" content="Python documentation" />
...
<meta property="og:image:width" content="200" />
<meta property="og:image:height" content="200" />And adds: <meta property="og:image:width" content="1146" />
<meta property="og:image:height" content="600" />
<meta property="og:image" content="https://docs.python.org/3/_images/social_previews/summary_library_mm_8b5ad9c4.png" />
<meta property="og:image:alt" content="The modules described in this chapter implement various algorithms or interfaces that are mainly useful for multimedia applications. They are available at th..." />
...
<meta name="twitter:card" content="summary_large_image" />There's a problem: we're referring to a file at This comes from It didn't matter before that all versions referred to the static https://docs.python.org/3/_static/og-image.png logo. |
|
Build times: Images are only built when the The default RTD build time doesn't change because the It might be useful to have them on RTD for testing social cards, but we can decide on that later. Locally we also don't build images for the same reason, but on macOS:
I expect it would be slower on older systems, and there's not much need for them locally. It's not too hard to enable it if needed (don't define |

For python/docsbuild-scripts#147, followup to #129085, partner to python/docsbuild-scripts#242.
Let's check the performance of this on 3.14 first, to make sure the extra images don't slow the build up too much or take up too much space.
📚 Documentation preview 📚: https://cpython-previews--129120.org.readthedocs.build/