djangoproject.com
djangoproject.com copied to clipboard
Better opengraph tags for docs
Currently when you link to the docs (say in slack, discord, etc.) the embed is not very useful, it looks a bit unprofessional IMO.
![Screenshot 2023-03-30 at 12 00 38](https://user-images.githubusercontent.com/3871354/228801421-7da55855-f9eb-40ed-9da3-6be39781ebfc.png)
Currently when you link to the docs (say in slack, discord, etc.) the embed is not very useful, it looks a bit unprofessional IMO.
Improvements are welcome. Could you open a PR with enhancements that you think would make Open Graph tags more professional?
I'm unlikely to find time for it any time soon but perhaps in the DCEU sprints.
Let’s start by setting og:title
to match the title of the page? Seems like it’d be just the one-liner here: https://github.com/django/djangoproject.com/blob/ca352ba826d579268f5b133261c8186620728cfe/docs/templates/docs/doc.html#L4
@thibaudcolas took a crack at this: https://github.com/django/djangoproject.com/pull/1508
also ran into a few other things along the way :sweat_smile:
for what it's worth, it's also trivial to update og:description, which I could add as a part of #1508 . Is there text that would make more sense than "The web framework for perfectionists with deadlines."? Perhaps even just prepending "Django Documentation" similar to how the title is joined? That way we already have translations as well. So the full thing would be:
"Django Documentation | The web framework for perfectionists with deadlines."
I'm kind of meh about that idea. On the one hand, the current description feels like it could be improved. On the other, I'm not quite sure what the right improvement would be.
@czue I would say not bother with it here, probably we don't have anything good enough to use. Maybe the first bit of text from the page would work, if it's easy to get, but I imagine that would also be confusing on some pages.