djangoproject.com icon indicating copy to clipboard operation
djangoproject.com copied to clipboard

Better opengraph tags for docs

Open knyghty opened this issue 1 year ago • 6 comments

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

knyghty avatar Mar 30 '23 10:03 knyghty

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?

pauloxnet avatar Mar 30 '23 11:03 pauloxnet

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

knyghty avatar Mar 30 '23 14:03 knyghty

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 avatar Mar 26 '24 06:03 thibaudcolas

@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 avatar Mar 26 '24 07:03 czue

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 avatar Mar 26 '24 11:03 czue

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

knyghty avatar Mar 26 '24 12:03 knyghty