metaformats-brainstorming

From Microformats Wiki
Revision as of 21:25, 1 April 2022 by Tantek (talk | contribs) (quote relevant sections from HTML spec)
Jump to navigation Jump to search

This page is for documenting brainstorming related to the metaformats.

Which HTML tags

See https://html.spec.whatwg.org/#metadata-content for tags to consider.

meta

The meta, obviously, for Open Graph Protocol and Twitter Cards at least. Are there any others?

  • Only in the head?
  • Or should we specify how to parse meta tags in the body as well?
    • Do any existing consuming code (that supports meta in the head) do anything with meta tags in the body?

Which attributes on meta

class

The meta tag does support the class attribute, but should we use it?

name

The HTML specification defines the meta name attribute: https://html.spec.whatwg.org/#attr-meta-name

If a meta element has a name attribute, it sets document metadata.

This implies that absent a name attribute, a meta element does not set document metadata. Thus if microformats are to support parsing metadata from meta elements in a manner compatible with what HTML requires, microformats must use the name attribute.

Document metadata is expressed in terms of name-value pairs, the name attribute on the meta element giving the name … The name specifies what aspect of metadata is being set; …

Since microformats has the similar model of name/value pairs in the form of properties and values, microformats should use the name attribute to express property semantics to follow this portion of the HTML specification.

As a fallback, should microformats also allow using the class attribute on meta tags? Or at least specify what should happen if it is present?

content

The HTML specification defines the meta content attribute: https://html.spec.whatwg.org/#attr-meta-content

Document metadata is expressed in terms of name-value pairs, … the content attribute on the same element giving the value. … valid names and the meaning of their values are described in the following sections. If a meta element has no content attribute, then the value part of the metadata name-value pair is the empty string.

property

Only for backcompat with Open Graph Protocol.

See Also