Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :ogp_disable: metadata field #86

Merged
merged 5 commits into from
Sep 8, 2023

Conversation

shiftinv
Copy link
Contributor

@shiftinv shiftinv commented Nov 8, 2022

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 :)

@TheTripleV
Copy link
Member

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?

@Daltz333
Copy link
Member

Daltz333 commented Nov 9, 2022

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.

@shiftinv
Copy link
Contributor Author

shiftinv commented Nov 9, 2022

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.

@Daltz333 Daltz333 merged commit 457e75d into wpilibsuite:main Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants