Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workshops: Auto-generated excerpts will always be empty #46

Closed
coreymckrill opened this issue Aug 10, 2020 · 2 comments · Fixed by #123
Closed

Workshops: Auto-generated excerpts will always be empty #46

coreymckrill opened this issue Aug 10, 2020 · 2 comments · Fixed by #123
Assignees
Labels
[Type] Bug Something isn't working on the Learn website.
Milestone

Comments

@coreymckrill
Copy link
Contributor

In #33 we're enabling excerpts for our workshop post type so that it can be used to show a summary of the workshop content in other places on the learn site where a workshop might be featured or called out. However, the excerpt_remove_blocks function that gets called during excerpt auto-generation is stripping out all of the workshop content, leaving a blank excerpt. This is because we're using core/group blocks in our content template, which excerpt_remove_blocks does not support (even though it supports core/columns). There's a Core ticket about this issue, so it this behavior may change eventually, but in the mean time, we'll need to ensure that all featured workshops have a manual excerpt.

I'm opening this issue to document why our excerpts are blank, and provide a space to discussion alternative solutions (or inspire someone to submit a Core patch!)

@coreymckrill coreymckrill added the [Type] Bug Something isn't working on the Learn website. label Aug 10, 2020
@coreymckrill coreymckrill added this to the Later milestone Aug 10, 2020
@StevenDufresne
Copy link
Contributor

Looking at the template, we could implement the layout without the groups. It would couple our CSS with Gutenberg classes which isn't great, but we would get the excerpt back in return.

With that being said, any updates to the templates would require an update to the existing data. I'm not sure what the options our for updating templates within existing content.

@coreymckrill
Copy link
Contributor Author

Looking at the template, we could implement the layout without the groups. It would couple our CSS with Gutenberg classes which isn't great, but we would get the excerpt back in return.

We might not even have to give up our custom classes. A lot of them could potentially be moved to other blocks (like the Columns block, or the individual nested Column blocks inside) and it may not even change the style hierarchy that much.

With that being said, any updates to the templates would require an update to the existing data. I'm not sure what the options our for updating templates within existing content.

Yeah, that could end up being a pain. This might be a downside of using block templates instead of hard-coded theme templates for stuff like this. At least right now there aren't that many workshops so it wouldn't take too long to migrate stuff over.

@coreymckrill coreymckrill self-assigned this Sep 23, 2020
coreymckrill added a commit that referenced this issue Sep 24, 2020
This removes all of the `core/group` blocks from the template and
reassigns their custom class names to the wrapping column blocks or
inner blocks where appropriate. A little bit of additional styling
was necessary to ensure the layout remains the same for both the old
and new markup.

With no group blocks in the mix, excerpts will now be automatically
generated for workshop posts.

Fixes #46
coreymckrill added a commit that referenced this issue Oct 1, 2020
)

This removes all of the `core/group` blocks from the template and reassigns their custom class names to the wrapping column blocks or inner blocks where appropriate. A little bit of additional styling was necessary to ensure the layout remains the same for both the old and new markup.

With no group blocks in the mix, excerpts will now be automatically generated for workshop posts.

Fixes #46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working on the Learn website.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants