-
Notifications
You must be signed in to change notification settings - Fork 361
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
Curator: revise single template #5987
Conversation
There was a problem hiding this 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.
curator/templates/single.html
Outdated
<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}} --> |
There was a problem hiding this comment.
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).
curator/templates/single.html
Outdated
<!-- 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"} /--> |
There was a problem hiding this comment.
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
curator/templates/single.html
Outdated
@@ -1,28 +1,121 @@ | |||
<!-- wp:template-part {"slug":"header","tagName":"header"} /--> | |||
<!-- wp:template-part {"slug":"header","theme":"curator","tagName":"header"} /--> |
There was a problem hiding this comment.
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:
<!-- wp:template-part {"slug":"header","theme":"curator","tagName":"header"} /--> | |
<!-- wp:template-part {"slug":"header","tagName":"header"} /--> |
Same for the footer part.
curator/templates/single.html
Outdated
|
||
<!-- wp:post-content {"layout":{"inherit":true}} /--> | ||
<!-- wp:post-comments-count {"textAlign":"center","fontSize":"x-large"} /--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curator/templates/single.html
Outdated
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.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.So, to accomplish that I tried using the method below but it doesn't seem to work, would you please guide me on that.
Thanks once more @jffng . |
There was a problem hiding this 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.
Thank you guys @madhusudhand @jffng |
@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:
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? There are a couple of issues that I think we should address in follow ups before this PR gets too big:
|
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. |
Thank you all for your work. @jffng I'll review the Single Post template and give feedback.
In the post template, just categories and post date. |
@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 @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 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 |
Thanks @madhusudhand |
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?
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.
@PeterNdomano these changes appear seem to be working for me! |
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
Ohhh...! I think it was an issue with caching on my end. |
f93db6f
to
db361da
Compare
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! |
…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