django / djangoproject.com

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

Meta tag `title` should contain the actual title, not just "Django" #1491

Closed nemecek-filip closed 6 months ago

nemecek-filip commented 6 months ago

Hello,

first time creating issue here...

I was saving some links from the docs and the app I am using fetches the og meta tags to create preview card. However all my cards have title just "Django" because this is the value of the og:title.

I think it makes sense to use the same title as for the page itself.

For example this page https://docs.djangoproject.com/en/5.0/ref/models/indexes/ has the below values:

 <title>Model index reference | Django documentation | Django</title>

<meta property="og:title" content="Django" />
bmispelon commented 6 months ago

Hello, welcome, and thanks 😄

What you're proposing sounds very reasonable and it seems to me like it would be a net positive.

It seems that the base template has all the right blocks that this should be doable: https://github.com/django/djangoproject.com/blob/main/djangoproject/templates/base.html#L23

I'm not super familiar with the templates for the docs part of the site, but it seems the file to edit would be docs/templates/docs/doc.html: https://github.com/django/djangoproject.com/blob/main/docs/templates/docs/doc.html#L4

Would you like to try submitting a PR for this?

nemecek-filip commented 6 months ago

I can try, but I am quite scared by the 13-step process to run the project localy.

I vaguely remember trying to run it some time ago and I couldn't 😵‍💫

bmispelon commented 6 months ago

Yes, it's a little daunting to say the least, I agree.

If you run into trouble, you can ask here or on the Django discord server (you can ping me in the #contributor-discussion channel) and we can try and figure it out together.

thibaudcolas commented 6 months ago

Closing as a duplicate of #1333. Be great to get this fixed!