Skip to content

Custom description (?) #41

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

Closed
eguidotti opened this issue May 25, 2021 · 6 comments
Closed

Custom description (?) #41

eguidotti opened this issue May 25, 2021 · 6 comments

Comments

@eguidotti
Copy link

Thanks for the nice package! I'm wondering if there is a way to set up a custom og:description tag for a given page.
I tried via the ogp_custom_meta_tags but this generates two og:description tags (the default one + custom tag). Would it be possible to remove the default og:description if it is provided in ogp_custom_meta_tags?

Also, it seems that og:description is ignoring the html description meta tag. Shouldn't it match the html description meta tag if it is provided?

Many thanks!

@Daltz333
Copy link
Collaborator

Daltz333 commented May 25, 2021

This is already being resolved by a WIP PR #35

Also, we can't just detect when standard html description is being used because ReadTheDocs overrides this for all projects, and using that will sorta defeat the purpose of intelligent OpenGraph descriptions.

@eguidotti
Copy link
Author

Thanks a lot for your answer! That's great it is already solved.

Would you mind sharing a code snippet to override the og:description? Or link to some resources to understand how to do that? I've been trying to browse PR #35 but I'm still not able to override the description.

Many thanks!

@eguidotti
Copy link
Author

Mmm, I just realized that #35 is unmerged so it looks like the issue isn't solved yet. I opened #42 specifically for og:description and avoid printing an empty tag. Hope this makes sense :)

@TheTripleV
Copy link
Collaborator

There currently is not a way to specify custom tags on a per-page level with this extension.

I had begun the work to add that functionality at https://github.com/TheTripleV/sphinxext-opengraph/tree/injections2. I'll pickup work on this feature again soon.

ogp_custom_meta_tags adds the specified metadata to all pages, which I would not recommend for a description.

@eguidotti
Copy link
Author

@TheTripleV Thanks for your efforts on this project! Yes I agree that the custom meta tags would not be recommended for the description. But mine is a very small website and it would do the trick :)

@eguidotti
Copy link
Author

#42 works like a charm. I guess I can close this issue and wait for #35 to be merged. Thanks again!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants