This repository was archived by the owner on Jun 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 174
Add a home page template using the latest posts block to 2019 #20
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- wp:group {"align":"full","className":"site-header"} --> | ||
| <div class="wp-block-group alignfull site-header"><div class="wp-block-group__inner-container"><!-- wp:template-part {"slug":"header","theme":"twentynineteen-blocks"} /--></div></div> | ||
| <!-- /wp:group --> | ||
|
|
||
| <!-- wp:group {"align":"full","className":"site-content"} --> | ||
| <div class="wp-block-group alignfull site-content"><div class="wp-block-group__inner-container"><!-- wp:post-title /--><!-- wp:post-content /--></div></div> | ||
| <!-- /wp:group --> | ||
|
|
||
| <!-- wp:group {"align":"full","className":"site-footer"} --> | ||
| <div class="wp-block-group alignfull site-footer"><div class="wp-block-group__inner-container"><!-- wp:template-part {"slug":"footer","theme":"twentynineteen-blocks"} /--></div></div> | ||
| <!-- /wp:group --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,19 +97,59 @@ Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-me | |
| } | ||
| } | ||
|
|
||
| /* Post title positioning */ | ||
| /* Site content positioning */ | ||
|
|
||
| .wp-site-blocks .site-content > .wp-block-group__inner-container > h1:first-child { | ||
| .wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide) { | ||
| max-width: calc(100% - (2 * 1rem)); | ||
| margin: 0 1rem; | ||
| } | ||
|
|
||
| @media only screen and (min-width: 768px) { | ||
| .wp-site-blocks .site-content > .wp-block-group__inner-container > h1:first-child { | ||
| max-width: 80%; | ||
| margin: 0 10%; | ||
| padding: 0 60px; | ||
| } | ||
| .wp-site-blocks .site-content > .wp-block-group__inner-container > *:not(.align-full):not(.align-wide) { | ||
|
kjellr marked this conversation as resolved.
|
||
| max-width: 80%; | ||
| margin: 0 10%; | ||
| padding: 0 60px; | ||
| } | ||
| } | ||
|
|
||
| /* Latest posts block */ | ||
|
|
||
| .wp-block-latest-posts { | ||
| padding-left: 0; | ||
| } | ||
|
|
||
| .wp-block-latest-posts li > a { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One potential answer for this would be this proposal WordPress/gutenberg#20290 |
||
| font-size: 2.25em; | ||
| font-weight: 700; | ||
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; | ||
| color: #111; | ||
| line-height: 1.2; | ||
| } | ||
|
kjellr marked this conversation as resolved.
|
||
|
|
||
| .wp-block-latest-posts.wp-block-latest-posts__list li > a::before { | ||
| background: #767676; | ||
| content: "\020"; | ||
| display: block; | ||
| height: 2px; | ||
| margin: 1rem 0; | ||
| width: 1em; | ||
| } | ||
|
|
||
| .wp-block-latest-posts.wp-block-latest-posts__list li:not(:first-child) { | ||
| margin-top: calc(6 * 1rem); | ||
| } | ||
|
|
||
| .wp-block-latest-posts .wp-block-latest-posts__post-date { | ||
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; | ||
| font-size: 0.71111em; | ||
| margin-top: 0.71111em; | ||
| margin-bottom: 1.5em; | ||
| } | ||
|
|
||
| @media only screen and (min-width: 768px) { | ||
| .wp-block-latest-posts__post-excerpt { | ||
| max-width: calc(6 * (100vw / 12) - 28px); | ||
| } | ||
| } | ||
|
|
||
| /* Site navigation styles */ | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm showing 100 posts now because pagination is not supported yet.
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.
I'm also showing the excerpt, post date and title. Ideally, this would use a "Query" block where you could decide to show post comment count... (but the query block is not implemented yet).
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.
Definitely should be a Query since we need to read from the query context. It's also why I don't think adding pagination support to latest posts is a great idea: WordPress/gutenberg#19969 (comment)