Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 22, 2022 04:34 pm GMT

For embeds, does DEV use Open Graph tags? And what is the minimum set of OG tags required by DEV for an embed to work?

My two part question is the title of the post. But here is a bit more context.

I'm assuming DEV uses Open Graph tags for processing embeds of websites. As an experiment, I tried to embed a page that did not have open graph tags, with the following {% embed https://url/to/page/without/open/graph/tags %} and the behavior was reasonable for such a page (e.g., a link to the page with the URL as the text of the link and nothing else). You can't really do much else if you aren't given the relevant data.

When trying the same with a page that has og:url, og:title, og:image, og:image:width, and og:image:height, DEV.to's preview in the editor results in the error: Liquid error: internal. Here's a specific example in markdown:

{% embed https://www.cicirello.org/ %}

Along with what the above produces (assuming the actual post shows same below as the preview in the editor):

Liquid error: internal

Am I correct that Open Graph tags are used when processing embeds in a DEV.to post? And if so, what is the minimum set that are required for an embed to work correctly?

I'm guessing that my error might be the lack of og:type because that is the only one of the four that the Open Graph protocol lists as required (og:title, og:type, og:image, og:url) that I don't currently have. But further down in the Open Graph protocol, it says "Any non-marked up webpage should be treated as og:type website." I was (probably incorrectly) assuming that leaving og:type out implies website for the type, which is why I left it out. That appears to be the behavior on other sites that use OG tags (e.g., LinkedIn), website assumed if tag not present.

But another possibility is my lack of og:description, which seems to be commonly used, but not listed among the required tags in the protocol.

Anyway, which tags does DEV require for embeds to work?


Original Link: https://dev.to/cicirello/for-embeds-does-dev-use-open-graph-tags-and-what-is-the-minimum-set-of-og-tags-required-by-dev-for-an-embed-to-work-3kh3

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To