Gutenberg: My Issues (2022 version)
This is a place to document issues I'm finding as I build my theme. A lot of these issues may be caused by my lack of experience with Gutenberg and the way the full site editor works. I will file issues about these items in the Gutenberg repo where I feel it's necessary. ## Adjusting Expectations One of the things I'm not sure works as intended or that I'm not understanding correctly is how the full site editor works. If I'm understanding this correctly, the changes on the editor should be reflected in the corresponding file I'm editing and vice-versa, right? This is not the case. I've made extensive changes to the theme I'm working on and none of those changes are reflected in the file I'm working with. Likewise, I've made significant changes in template files and they are not reflected in the editor. I asked the question in WordPress Slack and the answer I got was it was working as designed. > That's actually deliberate, even if it's initially confusing. The customizations that you use within the site editor are saved as CPTs. You can export the templates to get the HTML version if you want to put them into the code, but this way the user's changes are non-destructive and you can safely update the theme or even change themes and keep your templates. You can't export the theme.json file yet, but that's coming. (edited) > > From: [Make WordPress Slack — core-editor discussion](https://wordpress.slack.com/archives/C02QB2JS7/p1644781268400009) It appears that if I want to continue creating block themes, I will have to use the full site editor as the source of truth and remember to export the files periodically and to update the editor to match the layout if I'm making changes directly to the template. See these Github Issues for context and discussion on the issue: * [How to sync edits made within a theme's HTML files to the Block Editor (Full-site editing)](https://github.com/WordPress/gutenberg/issues/22469) * See [this comment](https://github.com/WordPress/gutenberg/issues/22469#issuecomment-669210648) in particular for a way to potentially edit the content on the file system and have it automatically reflect on the editor and the front end * [On Locking and TemplateLocking](https://github.com/WordPress/gutenberg/issues/29864). ## Poor or non-existent block documentation Documentation for the blocks API is sparse and, almost, non-existent. I thought the Storybook section of the Gutenberg repo may help but I found out that it is for Gutenberg's low-level components, not the blocks that we use in the editor. I believe the only way to get a good idea of what the core blocks can do is to create a layout that you like and then copy it or export it into your favorite editor to see how it works and if there are any attributes worth documenting for future use. ## Mixing HTML with template content I'm trying to get something like this in the full site editor: ```html
Posted by: Carlos
Posted on: February 22, 2021
``` The current layout is a nested column layout. The label is a paragraph element, and the author name and date posted are Gutenberg elements inside a `div` element so we can make it into a flexbox layout. ```htmlPosted by:
posted on: