leoloso / block-metadata

WordPress plugin to extract all metadata from all Gutenberg blocks inside of a post
GNU General Public License v2.0
12 stars 3 forks source link

Exposing Block Style #1

Open dmgawel opened 4 years ago

dmgawel commented 4 years ago

Hi!

It looks like it's a first issue so let me start with thanking you for an eye-opening plugin and concept :-)

I'm currently experimenting with WP <-> Hugo approach and I tried block-metadata. One (very important for me) missing bit is block styles. It's a built in WP feature and is stored as block class (is-style-*). Extracting it and returning along other metadata would be very useful.

leoloso commented 4 years ago

Hi Dawid,

do you want to code that feature? I think it should not be very difficult. You can check any of the other examples (in this file)... If you do it and come across any problem, I explained how it all works in this article), and I can help along the way, just let me know.

One thing to consider: is-style-* applies only for the web! Hence, it should possibly not be included in this repo, since its main intention is to make blocks completely platform agnostic. It should, instead, go under a different repo which deals with web cases, such as "block-metadata-for-web"... Then, through hooks, you could add more properties to the block metadata...