How to specify a link image URL header?

10 views
Skip to first unread message

Luc Saffre

unread,
Nov 7, 2021, 11:04:51 PM11/7/21
to sphinx...@googlegroups.com
Hi all,

when somebody shares,
in a social media platform, a link to a website generated by Sphinx, the platform analyzes the content to find out a title and a picture for that link. Facebook for example looks for a link image URL header. If no such header is present, it probably looks for the first picture on the page, which is not necessarily what we want. How can we spcify an explicit link image url for a page?

Luc

Komiya Takeshi

unread,
Nov 8, 2021, 10:27:38 AM11/8/21
to sphinx...@googlegroups.com
How about https://pypi.org/project/sphinxext-opengraph/?

2021年11月8日(月) 13:04 Luc Saffre <luc.s...@gmail.com>:
>
> Hi all,
>
> when somebody shares, in a social media platform, a link to a website generated by Sphinx, the platform analyzes the content to find out a title and a picture for that link. Facebook for example looks for a link image URL header. If no such header is present, it probably looks for the first picture on the page, which is not necessarily what we want. How can we spcify an explicit link image url for a page?
>
> Luc
>
> --
> You received this message because you are subscribed to the Google Groups "sphinx-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/f0efdb12-1d0d-e68d-6ccd-5cbd1fcbfdbb%40gmail.com.

Luc Saffre

unread,
Nov 9, 2021, 6:53:54 AM11/9/21
to sphinx...@googlegroups.com, Komiya Takeshi
Thank you, this is indeed an interesting extension!
But it is not enough for me. It tells Facebook to specify a global link image URL header for every page on my website.
That's nice, but I want to be able to say *on certain pages* that this particular page has a custom link image URL.
I guess that I must say it either by a file-wide metadata field or using a directive.
I will wait a few days before trying to write something myself, maybe you get more ideas.

Luc
Reply all
Reply to author
Forward
0 new messages