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

Curator: revise single template #5987

Merged
merged 21 commits into from
Jun 13, 2022

Conversation

PeterNdomano
Copy link
Contributor

@PeterNdomano PeterNdomano commented May 10, 2022

…issues #5931

Changes proposed in this Pull Request:

Edited curator/templates/single.html to meet the design suggested in #5931 for single post view. Made the template file completely compatible with FSE.

Related issue(s):

#5931

@jffng jffng added the [Theme] Vivre Automatically generated label for Vivre. label May 10, 2022
Copy link
Contributor

@jffng jffng left a comment

Choose a reason for hiding this comment

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

Thank you for this @PeterNdomano ! Very cool, also nice to see the new post comments blocks in action.

I left some initial comments.

<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"30px","bottom":"30px"}},"border":{"top":{"color":"var:preset|color|foreground","width":"2px"},"bottom":{"color":"var:preset|color|foreground","width":"2px"}}},"layout":{"inherit":false}} -->
Copy link
Contributor

Choose a reason for hiding this comment

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

The width of the separator here should be 1px, and it should also extend full width (touching the edges of the screen).

<!-- wp:group {"style":{"spacing":{"padding":{"top":"30px","bottom":"30px"}},"border":{"top":{"color":"var:preset|color|foreground","width":"2px"},"bottom":{"color":"var:preset|color|foreground","width":"2px"}}},"layout":{"inherit":false}} -->
<div class="wp-block-group" style="border-top-color:var(--wp--preset--color--foreground);border-top-width:2px;border-bottom-color:var(--wp--preset--color--foreground);border-bottom-width:2px;padding-top:30px;padding-bottom:30px"><!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group"><!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:post-navigation-link {"type":"previous","label":"\u003cstrong\u003ePREVIOUS POST\u003c/strong\u003e","fontSize":"large"} /-->
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to escape all strings, including these labels as well as line 66 ("Comments"). Also uppercase should be done via text transform / CSS.

To do this, maybe we should create a "hidden" pattern for the comments, like the 404 pattern: https://github.com/Automattic/themes/blob/trunk/curator/patterns/404.php#L5

@@ -1,28 +1,121 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:template-part {"slug":"header","theme":"curator","tagName":"header"} /-->
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's get rid of the theme slug here, so the templates and parts always resolve from the currently active theme:

Suggested change
<!-- wp:template-part {"slug":"header","theme":"curator","tagName":"header"} /-->
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

Same for the footer part.


<!-- wp:post-content {"layout":{"inherit":true}} /-->
<!-- wp:post-comments-count {"textAlign":"center","fontSize":"x-large"} /-->
Copy link
Contributor

Choose a reason for hiding this comment

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

There's quite a bit of space between the parenthesis and comments count here — any way we can reduce that?

Screen Shot 2022-05-10 at 11 27 47 AM

<div class="wp-block-group"><!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group"><!-- wp:post-navigation-link {"type":"previous","label":"\u003cstrong\u003ePREVIOUS POST\u003c/strong\u003e","fontSize":"large"} /-->

<!-- wp:post-navigation-link {"label":"\u003cstrong\u003eNEXT POST\u003c/strong\u003e","fontSize":"large"} /--></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

The font family should be Work Sans for the pagination:

Screen Shot 2022-05-10 at 11 30 30 AM

@jffng jffng linked an issue May 10, 2022 that may be closed by this pull request
@jffng jffng changed the title Edited curator/templates/single.html to meet the design suggested on … Curator: revise single template May 10, 2022
@PeterNdomano
Copy link
Contributor Author

PeterNdomano commented May 16, 2022

Thanks @jffng for your review. All the requested changes were covered in the commits but I would like to point out these 2 things:

1) I removed prev and next arrows in post navigation for mobile view to prevent the phrase "PREVIOUS POST" from wrapping over 2 lines. It's just my suggestion for mobile view, if it ain't right we can bring them back!.. Consider the images below.

on mobile
mobile-post-nav

on desktop
desktop-post-nav

2) I tried to detect if the post has a featured image inside the pattern curator/post-hero so that I can load specific cover block in order to match the targeted design, Consider images below.

without featured image
without-featured-image

with featured image
with-featured-image

So, to accomplish that I tried using the method below but it doesn't seem to work, would you please guide me on that.

<?php if ( has_post_thumbnail() ): ?>
<!-- wp:cover {"useFeaturedImage":true,"dimRatio":50,"overlayColor":"foreground","minHeight":100,"minHeightUnit":"vh"} -->
<!-- /wp:cover -->
<?php else: ?>
<!-- wp:cover {"overlayColor":"background","minHeight":50,"minHeightUnit":"vh","isDark":false} -->
<!-- /wp:cover -->
<?php endif; ?>

Thanks once more @jffng .

Copy link
Contributor

@madhusudhand madhusudhand left a comment

Choose a reason for hiding this comment

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

Hi @PeterNdomano, Thanks for splitting the page into multiple patterns.
I posted few comments inline.

curator/templates/single.html Outdated Show resolved Hide resolved
curator/patterns/post-navigation.php Outdated Show resolved Hide resolved
curator/patterns/post-hero.php Show resolved Hide resolved
@jffng jffng mentioned this pull request May 23, 2022
@PeterNdomano
Copy link
Contributor Author

Thank you guys @madhusudhand @jffng
I'll work on the changes ASAP

@jffng
Copy link
Contributor

jffng commented May 26, 2022

@PeterNdomano thanks for your work here, I made a number of changes to simplify this one a bit and work within the parameters of what's possible right now.

@beafialho I think this is in a decent spot to review. Here are a few scenarios to test the Single Post template:

  • With and without a featured image
  • Post containing wide and full width content
  • Adding some comments

I do think be useful to review and hopefully merge #5980 first, so that we can get a better sense of this template in context.

One question — is the meta supposed to display tags, categories, both, or just whether the post is featured or not?

Screen Shot 2022-05-26 at 12 57 40 PM

There are a couple of issues that I think we should address in follow ups before this PR gets too big:

@PeterNdomano
Copy link
Contributor Author

PeterNdomano commented May 26, 2022

Thanks @jffng I noticed that this PR still depends on some other unmerged PRs like this one on post meta and date as mentioned by @madhusudhand in the previous review. So I thought I had to wait for those PRs to get merged first, that's why I didn't commit yet after your last reviews. However, I hope review & clarification from @beafialho will help us to keep going with this PR.

@beafialho
Copy link
Collaborator

Thank you all for your work. @jffng I'll review the Single Post template and give feedback.

One question — is the meta supposed to display tags, categories, both, or just whether the post is featured or not?

In the post template, just categories and post date.

@beafialho
Copy link
Collaborator

I tried some of those options you mentioned:

  • This is what a post with a long title looks like, quite tight. I tried adding 120px padding above and below (not on the sides) and it looks better.
Currently With top and bottom padding
Captura de ecrã 2022-05-27, às 10 36 51 Captura de ecrã 2022-05-27, às 10 38 28
  • The post category is underlined by default. It shouldn't be, it should be underlined on hover.

Captura de ecrã 2022-05-27, às 11 06 31

  • Comments look good in general! My only comment is: can the Reply and Edit buttons use a smaller size? They shouldn't be as highlighted as the text.

Captura de ecrã 2022-05-27, às 10 45 21

@madhusudhand
Copy link
Contributor

@PeterNdomano The design of the category, date pattern changed to different style in archive pages. You no longer need to depend on the other PR. Please style them with above design.

@PeterNdomano
Copy link
Contributor Author

Thanks @beafialho for your review.

@jffng I added 120px padding on top and bottom inside the inner cover and now it looks fine. I tried to modify fontSize using {"fontSize":"medium"} inside comment-content block and {"fontSize":"small"} inside both reply and edit links in order to differentiate the sizes as suggested, but unfortunately they don't seem to work. Perhaps it's an issue with these comment blocks and maybe we should use raw CSS.

Regarding the underlining of post-category before hover I hope @jffng will have a better solution coz last time I tried to do it with raw CSS inside styles.css file

@PeterNdomano
Copy link
Contributor Author

@PeterNdomano The design of the category, date pattern changed to different style in archive pages. You no longer need to depend on the other PR. Please style them with above design.

Thanks @madhusudhand

@jffng
Copy link
Contributor

jffng commented May 27, 2022

Thanks everyone!

I tried a long title and the top and bottom padding look better, but maybe we should add some to the sides as well since you can end up in situations like the following depending on the word length?

Screen Shot 2022-05-27 at 10 43 21 AM

The post category is underlined by default. It shouldn't be, it should be underlined on hover.

Yeah, I was hoping we can address that as a part of #6028, since that one is handling link styles and we will want to be concise with those rules.

I tried to modify fontSize using {"fontSize":"medium"} inside comment-content block and {"fontSize":"small"}

@PeterNdomano these changes appear seem to be working for me!

Screen Shot 2022-05-27 at 10 50 02 AM

@PeterNdomano
Copy link
Contributor Author

but maybe we should add some to the sides as well since you can end up in situations like the following depending on the word length?

Yeah, that's right. I just added 20px left and right padding. I chose 20px after some number of tests to make sure it displays well on both mobile and desktop. What do you think about it @jffng

these changes appear seem to be working for me!

Ohhh...! I think it was an issue with caching on my end.

@jffng jffng force-pushed the Curator-Templates-Single branch from f93db6f to db361da Compare June 13, 2022 15:02
@jffng
Copy link
Contributor

jffng commented Jun 13, 2022

I just added 20px left and right padding. I chose 20px after some number of tests to make sure it displays well on both mobile and desktop. What do you think about it

Let's use the same outer spacing value as the rest of the site's padding here. I updated that in d6529ca

I've addressed the remaining feedback from @beafialho and rebased this one, I think it's in a good spot to bring in. There is one dependency on a GB PR ( WordPress/gutenberg#41378 ) but I don't think that should hold this up. Thanks @PeterNdomano @madhusudhand @beafialho!

@jffng jffng merged commit deee5ab into Automattic:trunk Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Theme] Vivre Automatically generated label for Vivre.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Curator: Templates: Single
4 participants