I don't think we should add them manually, but use an extension to automate the creation instead.
sphinxext-opengraph already does this for OGP meta tags (including automatically setting the title and description), but apparently not for regular meta tags. I haven't checked yet if there are other extensions that can add those, if not, we can create one similar to sphinxext-opengraph or make a PR against it to add this feature (if they are interested).
sphinxext-opengraph already does this for OGP meta tags (including automatically setting the title and description), but apparently not for regular meta tags. I haven't checked yet if there are other extensions that can add those, if not, we can create one similar to sphinxext-opengraph or make a PR against it to add this feature (if they are interested).
<metaproperty="og:title" content="The initialization of the sys.path module search path" /><metaproperty="og:type" content="website" /><metaproperty="og:url" content="https://docs.python.org/3/library/sys_path_init.html" /><metaproperty="og:site_name" content="Python documentation" /><metaproperty="og:description" content="A module search path is initialized when Python starts. This module search path may be accessed at sys.path. The first entry in the module search path is the directory that contains the input scrip..." /><metaproperty="og:image" content="https://docs.python.org/3/_static/og-image.png" /><metaproperty="og:image:alt" content="Python documentation" /><metaname="description" content="A module search path is initialized when Python starts. This module search path may be accessed at sys.path. The first entry in the module search path is the directory that contains the input scrip..." /><metaproperty="og:image:width" content="200" /><metaproperty="og:image:height" content="200" />
Activity
Mariatta commented on Oct 5, 2022
I think this is where we could get expert advice on what to write inside the title and description meta tags.
ezio-melotti commented on Oct 6, 2022
I don't think we should add them manually, but use an extension to automate the creation instead.
sphinxext-opengraph already does this for OGP meta tags (including automatically setting the title and description), but apparently not for regular meta tags. I haven't checked yet if there are other extensions that can add those, if not, we can create one similar to sphinxext-opengraph or make a PR against it to add this feature (if they are interested).
See also:
hugovk commented on Oct 6, 2022
They're interested, there's a feature request to add <meta name="description">: sphinx-doc/sphinxext-opengraph#65).
Mariatta commented on Oct 6, 2022
The extension looks interesting. Looking at the comments, it seems like we can probably use the ogp_custom_meta_tags?
hugovk commented on Oct 18, 2022
We can't use ogp_custom_meta_tags because they would be hardcoded for all pages, and we'd like them generated for each page.
I've created a PR for this: sphinx-doc/sphinxext-opengraph#71.
hugovk commented on Aug 4, 2023
Description meta tags have now been added by python/cpython#99931.
For example, https://docs.python.org/3/library/sys_path_init.html has:
See also #63 (comment).
StanFromIreland commented on Feb 24, 2025
The auto generation is not the best:
Maybe this should be revisited? Adding them manually for key pages?
hugovk commented on Feb 24, 2025
The frontpage itself is a template page, and therefore sphinxext-opengraph doesn't generate tags for it.
So yes, we should manually add tags for that page. Would you like to open a new issue for it?
For comparison, here's one that is generated:
StanFromIreland commented on Feb 24, 2025
Where to open it? Here or cpython? I can push a pr with the tags.