django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 938 forks source link

Better opengraph tags for docs #1333

Open knyghty opened 1 year ago

knyghty commented 1 year ago

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
pauloxnet commented 1 year ago

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?

knyghty commented 1 year ago

I'm unlikely to find time for it any time soon but perhaps in the DCEU sprints.

thibaudcolas commented 3 months ago

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

czue commented 3 months ago

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

czue commented 3 months ago

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.

knyghty commented 3 months ago

@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.