Open Graph validation for HTML5

后端 未结 12 713
情歌与酒
情歌与酒 2020-11-29 01:04

Is there any way to get facebook\'s crappy Open Graph meta tags to validate if my doctype is (HTML5)?

Other than facebook\'s Open

12条回答
  •  难免孤独
    2020-11-29 01:43

    Many of the answers here have become outdated. Please don't snoop for headers or write via JavaScript (since the processors might not evaluate the JS).

    The W3C Recommendations (Extensions to HTML5) called RDFa 1.1 and RDFa Lite 1.1 (see http://www.w3.org/TR/rdfa-lite/ and http://www.w3.org/TR/rdfa-primer/ ) have made the "property" attribute valid and conforming. In the mean time (since the older answers here) the validator http://validator.w3.org/check recognizes the attribute as valid. In addition, the Open Graph Protocol documentation, http://ogp.me/ , has been updated to reflect RDFa 1.1 (it uses the "prefix" attribute).

    The W3C work has been done with input from OpenGraph and schema.org among others to resolve the kind of issue raise by this question.

    In short, make sure your OG tags conform to RDFa and you are golden.

提交回复
热议问题