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

Twenty Twenty-One Blocks: Add post meta. #75

Merged
merged 6 commits into from
Nov 8, 2020
Merged

Conversation

kjellr
Copy link
Collaborator

@kjellr kjellr commented Nov 4, 2020

This PR adds post meta to the footer of posts. For reference, here are the original theme styles for these:

Screen Shot 2020-11-04 at 2 12 54 PM

This PR gets somewhat close:

Screen Shot 2020-11-04 at 2 13 50 PM

  • It doesn't include any of the text before these, since the blocks don't support that yet.
  • It keeps the post author text in bold, since this is not yet changeable via Gutenberg or global styles.

The PR adds this to the bottom of all single post pages, and also to each post in the main query loop. While I was in there, I made the post titles clickable, which makes this all work way better in general. 😄

Example of a post in the main index feed:

Screen Shot 2020-11-04 at 2 40 43 PM

@kjellr kjellr added the enhancement New feature or request label Nov 4, 2020
@kjellr kjellr self-assigned this Nov 4, 2020
@@ -186,7 +186,7 @@ hr[style*="text-align: right"],

hr:not(.is-style-wide):not(.is-style-dots),
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
max-width: var(--responsive--aligndefault-width);
max-width: var(--wp--custom--responsive--aligndefault-width);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also fixed this variable name — it was incorrect, and was making the separator above the meta display incorrectly.

@carolinan
Copy link
Collaborator

The author block does support the text before (byline), was this left blank intentionally?

@kjellr
Copy link
Collaborator Author

kjellr commented Nov 5, 2020

The author block does support the text before (byline), was this left blank intentionally?

It was — the byline is only set to show up above the author name, not next to it. I'm going to open a GitHub issue for that (as well as for the ability to un-bold the author name) in the Gutenberg repo today.

Edit: I added notes to this Gutenberg issue: WordPress/gutenberg#24952 (comment)

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Now the Query block will work as expected. I've left a couple of minor comments there.

We the template testing I found a bug in PostAuthor block which I'll fix in GB now.

twentytwentyone-blocks/block-templates/index.html Outdated Show resolved Hide resolved
@carolinan carolinan merged commit ffbfd31 into master Nov 8, 2020
@kjellr kjellr deleted the add/post-meta-tt1 branch November 9, 2020 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants