Repository navigation
Add meta tags to docs.python.org #65
Description
Activity
I think this is where we could get expert advice on what to write inside the title and description meta tags.
I don't think we should add them manually, but use an extension to automate the creation instead.
sphinxext-opengraphalready 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 tosphinxext-opengraphor make a PR against it to add this feature (if they are interested).See also:
Reacted by Mariattasphinxext-opengraphalready 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 tosphinxext-opengraphor make a PR against it to add this feature (if they are interested).They're interested, there's a feature request to add
<meta name="description">: sphinx-doc/sphinxext-opengraph#65).Reacted by Ezio Melotti and MariattaThe extension looks interesting. Looking at the comments, it seems like we can probably use the
ogp_custom_meta_tags?Reacted by Hugo van KemenadeWe can't use
ogp_custom_meta_tagsbecause they would be hardcoded for all pages, and we'd like them generated for each page.They're interested, there's a feature request to add
<meta name="description">: wpilibsuite/sphinxext-opengraph#65).I've created a PR for this: sphinx-doc/sphinxext-opengraph#71.
Reacted by C.A.M. GerlachDescription meta tags have now been added by python/cpython#99931.
For example, https://docs.python.org/3/library/sys_path_init.html has:
<meta property="og:title" content="The initialization of the sys.path module search path" /> <meta property="og:type" content="website" /> <meta property="og:url" content="https://docs.python.org/3/library/sys_path_init.html" /> <meta property="og:site_name" content="Python documentation" /> <meta property="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..." /> <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" /> <meta property="og:image:alt" content="Python documentation" /> <meta name="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..." /> <meta property="og:image:width" content="200" /> <meta property="og:image:height" content="200" />
See also #63 (comment).
Reacted by Manuel Kaufmann, Maciej Olko and Ege AkmanWhere to open it? Here or cpython? I can push a pr with the tags.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone


We need to add
<meta>tags to the output of sphinx documentation.It looks like this is supported using the
metadirectivehttps://docutils.sourceforge.io/docs/ref/rst/directives.html#meta
Example:
Some meta tags we should have:
titledescriptionSome advice according to: https://ahrefs.com/blog/seo-meta-tags/
Title meta:
Description meta: