0

Is there a setting I can tweak in conf.py to ensure that image previews are generated for links to my index.html?

I think I need to put a link to the image inside:

<head><meta name="og:image" content="https://.png" /></head>

Maybe a setting on one of the html_* options? I read through them, but did not see anything.

https://www.sphinx-doc.org/en/master/usage/configuration.html

enter image description here

Page to link to: https://aiqc.readthedocs.io/en/latest/

Kermit
  • 4,922
  • 4
  • 42
  • 74
  • 1
    This is totally dependent on your chosen Sphinx theme. Please check its documentation to see if this feature is supported. AFAIK, Sphinx out of the box has no such feature. You might be able to [modify a theme](https://stackoverflow.com/search?q=%5Bpython-sphinx%5D+customize+theme) to support image link previews. – Steve Piercy Jan 29 '21 at 05:40
  • https://github.com/readthedocs/sphinx_rtd_theme/issues/1042 – Kermit Jan 29 '21 at 14:01
  • The RTD theme does not support this feature. You must customize the RTD theme, or submit a pull request that adds this feature. Welcome to open source software, where non-existent features are created by the people who actually use them. – Steve Piercy Jan 29 '21 at 14:21
  • @StevePiercy looks like i live another day – Kermit Jan 30 '21 at 22:26

1 Answers1

0

One of many meta tags available in:

https://github.com/wpilibsuite/sphinxext-opengraph

conf.py

extensions = ['sphinxext.opengraph']

ogp_image = "https://raw.githubusercontent.com/aiqc/aiqc/main/docs/images/aiqc_logo_banner_controlroom.png"

It even has a field for user-defined <meta> tags.

Kermit
  • 4,922
  • 4
  • 42
  • 74