-
-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Many websites automatically generate a PNG "image preview" for social media sharing that contains the page title and some other page metadata. This uses the opengraph protocol for images, and so this functionality could be a useful part of this extension.
Proposal
Add the ability to optionally auto-generate an image preview for the page based on page metadata. It would display:
- The site title
- The site logo
- The page title
- Either a site tagline, hand-written page description, or the first several paragraphs of text.
In the future, it might also be able to display things like reading time or author ID, but this isn't built into Sphinx and is probably out of scope for a first PR.
Implementation
There's a prototype of this functionality already working at this repository:
It uses matplotlib to generate a little image for each page, and then links the og:image meta tag to that preview image.
Design ideas
I don't think it'll be productive if we fall down a long design hole, but I wanted to propose this structure to see if anybody had any major concerns or preferences for a different style. It is heavily inspired by the GitHub image previews (see below):
In this case, most of the elements (including colors) could be configurable, and able to be turned off.
There's also a figma link here but I think I might be the only one that can edit?
Here are a few design ideas to use for inspiration:



