Closed shiftinv closed 10 months ago
I'm assuming you'd still want some kind of nice embed on Twitter/Discord.
Wouldn't it be better for your API documentation to specify a custom title/description for that one page?
A possible strategy would be generating a bunch of stubs per function/variable/etc definition and have that redirect to a href reference of the original location. Things like discourse do this.
I'm assuming you'd still want some kind of nice embed on Twitter/Discord.
Wouldn't it be better for your API documentation to specify a custom title/description for that one page?
True that. Essentially, the core idea is to disable embeds for that page entirely to avoid clutter, since the description shown when linking to any symbol would always be the same and not particularly helpful; it's a pretty niche use case, admittedly.
A possible strategy would be generating a bunch of stubs per function/variable/etc definition and have that redirect to a href reference of the original location. Things like discourse do this.
I considered that as well, it'd be one of the best solutions in most cases. With the static nature of Sphinx however that would mean generating several hundred stub files - in our case, a quick document.querySelectorAll(".py.class").length
currently yields about 225 elements, or ~1500 if attributes are also taken into account.
Adds a way of disabling opengraph tags per-page using an
:ogp_disable:
field.We've had a need for something like this on things like API reference pages, which don't necessarily have a proper description and/or shouldn't have og tags for other reasons. This is more of a proposal and I'd understand if you don't want to add something like this, but it would be a step up from our current, somewhat hacky solution of hooking into the
html-page-context
callback :)