Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGraph HTML meta tags are broken or missing #1391

Open
ws909 opened this issue Sep 6, 2024 · 6 comments
Open

OpenGraph HTML meta tags are broken or missing #1391

ws909 opened this issue Sep 6, 2024 · 6 comments
Labels
area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: change request New feature or request

Comments

@ws909
Copy link
Contributor

ws909 commented Sep 6, 2024

I copied an answer of mine from SO to SD-CD, so I checked the HTML sources of the webpages on both websites to compare them, and found several issues with the CD page, some of which concern OpenGraph.

The problems I found in the HTML source for CD's page:

  • <meta property="og:type" content="website"/> is missing
  • <meta property="og:image" .../>'s URL is broken
  • <meta property="og:site_name" .../> is missing
@cellio
Copy link
Member

cellio commented Sep 6, 2024

What does this metadata do? I'm not familiar with OpenGraph and I'm not spotting differences in the rendered answers. Can you elaborate?

@ws909
Copy link
Contributor Author

ws909 commented Sep 6, 2024

I'm going through various SEO issues with Codidact, and this is one of the things covered by that. The OG API was first created by Facebook, and is now used by services to read a website and present it in a small format for instance on social media. Some sources claim search engines also use that data, although I am not entirely sure. Either way, I think it's important to resolve this.

@cellio cellio added area: ruby Changes to server-side code type: change request New feature or request priority: medium complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. labels Sep 6, 2024
ArtOfCode- added a commit that referenced this issue Sep 7, 2024
@ArtOfCode-
Copy link
Member

@ws909 re og:image being broken - where are you seeing this? The current code for it is <%= "https://#{RequestContext.community.host}#{SiteSetting['SiteLogoPath']}" %>, which off the top of my head should be correct.

@ws909
Copy link
Contributor Author

ws909 commented Sep 7, 2024

@ArtOfCode-

From the HTML source of the Software Development CD page linked in the first post. Currently at line 51 when I just now loaded it up in Safari (last tag in the <head>):

<meta property="og:image" content="https://software.codidact.comhttps://codidact.com/community-assets/software/logo-large.png"/>

@ws909
Copy link
Contributor Author

ws909 commented Sep 7, 2024

SiteLogoPath must be the full URL, yet the code assumes it's only a partial or relative URL.

@ArtOfCode-
Copy link
Member

Ah, I forgot we use full URLs there. It was built to use a path on the same domain but it doesn't actually make a difference... Except here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: change request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants