Open ws909 opened 2 months ago
What does this metadata do? I'm not familiar with OpenGraph and I'm not spotting differences in the rendered answers. Can you elaborate?
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.
@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.
@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"/>
SiteLogoPath
must be the full URL, yet the code assumes it's only a partial or relative URL.
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.
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