I need to add Open Graph tags to a blog page. It seems from reading the spec (http://ogp.me/) using an og:type
of article
is the way to go. However, I find the spec unclear and I'm unsure how to implement the syntax correctly.
Two example websites implement this differently for example:
Example from GitHub: (https://github.com/niallkennedy/open-graph-protocol-examples/blob/master/article-utc.html)
<head prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#"> <meta property="og:title" content="..."> <meta property="og:type" content="article"> <meta property="article:published_time" content="...">
Note the
og
andarticle
namespaces are registered and thatog
andarticle
are used as properties.BBC News article
<head> <meta property="og:title" content="..."> <meta property="og:type" content="article"> <meta property="og:article:author" content="...">
Note no namespace registration and
og
andog:article
are used as properties.A variation I've seen in the wild of the above, registering only the
og
namespace and still referencingog:article
as a property.<head prefix="og: http://ogp.me/ns#"> <meta property="og:title" content="..."> <meta property="og:type" content="article"> <meta property="og:article:published_time" content="..">
Option 3 is what I used the first time I tried to implement this. When I ran it through the Facebook validation tool I was told:
Objects of this type do not allow properties named 'og:article:published_time'.
For the moment, I have gone with option 1 and although this validates, I would like to know what the definitive correct syntax is?
article:author
must be url? coz my author doesn't have fb. – Chekhov