WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.41k stars 4.16k forks source link

Built-in, optional support for microformats2? #36091

Open reinhart1010 opened 2 years ago

reinhart1010 commented 2 years ago

I'm forwarding this issue from WordPress/twentytwentytwo#78 which was closed 3 days ago. Here's what the original report says:

microformats and microformats2 have existed for such a long time (first in 2005), and some people are still using it to allow their sites to be (semantically) discoverable by anyone.

My idea here is to sidechain a set of microformats2 class markups into the current set of WordPress-specific or theme-specific classes, like .e-content alongside .entry-content (as in the Twenty Twenty One theme), .h-card with a[rel="author"], .p-category alongside a[rel="category"] and a[rel="tag"]and so on.

I know that this would be redundant for such a theme, and not all site authors want their site to be discovered this way (i.e. by using microformats2), so I think it could be better to leave this as an optional feature, opt-in from the Customize menu that people have been familiar with.

At least it's better than using a WordPress plugin which apparently breaks in some themes due to HTML string sanitation, including Twenty Twenty One.

aristath commented 2 years ago

My 2 cents (personal opinion):

Any schema (whether that's microformats, RDFa or JSON-LD) should be done taking the whole page into account, holistically. Doing it on a per-block basis and adding stuff left and right without knowing the final result can't possibly be a good thing. It would be better not to have anything than to have something potentially wrong.

WordPress themes were (in the past) printing a lot of microformats markup, and that has contributed to a lot of noise and sites using the wrong microformats (or at least not something actually meaningful). In the past things like that have done more harm than good in many cases, so if we do something it should be done properly and not using quick-fixes that may or may not be 100% correct.

jonoalderson commented 2 years ago

Seconded.

Whilst I love the idea of Gutenberg blocks providing rich, semantic metadata, this feels like it opens up a can of worms and comes with some risk.

Some additional considerations: