Sendouc / sendou.ink

Competitive Splatoon Platform
https://sendou.ink
GNU General Public License v3.0
235 stars 76 forks source link

Improve Opengraph meta tags (discord and twitter previews) #1460

Open iam-nekk opened 1 year ago

iam-nekk commented 1 year ago

Hi there! Recently, while browsing through the sendou.ink discord, I've noticed that a lot of the link previews for the website either show general information about the website, or no information at all.

I did a little investigation to see what works and what would need improvement. Do bare in mind that I've only checked the part of the website that I see as "content". I also only tested them on discord.

Already implemented and functional:

Articles

image

Calendar Events

image

Implemented but needs improvements

Teams

image

Top search players

image

Not functional

User profiles

image

Vods

image

Rules

image

Badges

image

I'd like to work on this issue if you need any help. I love this wesite and I'd be delighted to contribute.

Sendouc commented 1 year ago

Hey! Thanks for opening an issue :) You are very right and I agree this would be a great avenue for contribution 👍 Let me know if you need help.

iam-nekk commented 1 year ago

Hi, thanks for the opportunity! I do actually have a question: is there any way for me to get stage and weapon name from their id? I can't seem to find anything for that

iam-nekk commented 1 year ago

About the SendouQ Rules page, would it be possible to use Markdown or something else instead of hard coding the rules in? Currently, I just copied the html, removed the tags, and made it the description, but that means that if the rules need to be changed, you'll need to write the same thing twice.

This might be worth making into its own issue, considering this also affect translation, which is currently not possible

Sendouc commented 1 year ago

Hi, thanks for the opportunity! I do actually have a question: is there any way for me to get stage and weapon name from their id? I can't seem to find anything for that

CTRL+F for game-misc:STAGE_. They are coming from translations. To see an example of loader+meta working together check out art.tsx

About the SendouQ Rules page, would it be possible to use Markdown or something else instead of hard coding the rules in? Currently, I just copied the html, removed the tags, and made it the description, but that means that if the rules need to be changed, you'll need to write the same thing twice.

This might be worth making into its own issue, considering this also affect translation, which is currently not possible

Yeah sounds good to make it a separate issue. The SendouQ feature itself is not translateable yet.

iam-nekk commented 1 year ago

Do you know what causes this error? image it doesnt stop the app from working at all, it's just a bit annoying

Sendouc commented 1 year ago

I'd need to see where t comes from. Probably the namespace is not set in the function that returns it.

iam-nekk commented 1 year ago

I'd need to see where t comes from. Probably the namespace is not set in the function that returns it.

Ah, my bad, I was using useTranslation(['common']), which I just copied from somewhere else. Changed it to useTranslation(['weapons','game-misc']) and the error is gone now!

iam-nekk commented 1 year ago

I'm having an issue when it comes to twitter not showing user profile pictures. This is how it looks like right now image When running the website through their card validator, it shows this warning image Which I find a bit strange, robots.txt doesnt prevent any user agents at all image I'm not really sure what to do about this to be honest

Edit: I should clarify, I build the link to the profile picture myself here: image

iam-nekk commented 1 year ago

Figured it out: this is an issue on discord's cdn side image They're disallowing twitter's user agents everything, except for a few execptions, which doesnt include avatars, meaning we either find a workaround, or drop the idea of showing profile pictures

Sendouc commented 1 year ago

Hmm yeah interesting. I mean would be of course cool to show them! But it can be tricky then unless we introduce proxy in between. Which might be overkill for this specific task.

iam-nekk commented 1 year ago

Hmm yeah interesting. I mean would be of course cool to show them! But it can be tricky then unless we introduce proxy in between. Which might be overkill for this specific task.

Well, adding a proxy wasn't actually too hard, the issue is, funnily enough, that it still doesn't work. I could keep going at it for hours but at that point I don't think it's worth it. Definitely worth looking into in the future though