Bladeren bron

[Livro] Fix wide and full width content in index/archive/home templates (#5385)

* Rework layout inheritance for query and post template.

* Wrap archive title in a group that inherits layout.

* Also unset the max-width

* Get the markup in all templates to match

* add post template

* update post template

* Refactor index, home and archive templates to share the post template

* Adding back the default layout

* fix alignments on pagination

* remove unneeded alignment rules

Co-authored-by: Ben Dwyer <ben@scruffian.com>
Jeff Ong 3 jaren geleden
bovenliggende
commit
9934d0e345
6 gewijzigde bestanden met toevoegingen van 42 en 61 verwijderingen
  1. 13 0
      livro/parts/post.html
  2. 2 2
      livro/style.css
  3. 12 19
      livro/templates/archive.html
  4. 6 18
      livro/templates/home.html
  5. 9 18
      livro/templates/index.html
  6. 0 4
      livro/templates/single.html

+ 13 - 0
livro/parts/post.html

@@ -0,0 +1,13 @@
+<!-- wp:group {"layout":{"inherit":true}} -->
+<div class="wp-block-group"><!-- wp:post-title {"isLink":true} /-->
+
+<!-- wp:post-date {"isLink":true,"format":"F jS, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /-->
+
+</div>
+<!-- /wp:group -->
+
+<!-- wp:post-content {"layout":{"inherit":true}} /-->
+
+<!-- wp:spacer {"height":112} -->
+<div style="height:112px" aria-hidden="true" class="wp-block-spacer"></div>
+<!-- /wp:spacer -->

+ 2 - 2
livro/style.css

@@ -3,7 +3,7 @@ Theme Name: Livro
 Theme URI: https://github.com/Automattic/themes/tree/trunk/livro
 Author: Automattic
 Author URI: https://automattic.com/
-Description: Livro is a simple theme designed to evoke the calm feeling you get when you settle in with a classic book. 
+Description: Livro is a simple theme designed to evoke the calm feeling you get when you settle in with a classic book.
 Requires at least: 5.8
 Tested up to: 5.8.3
 Requires PHP: 5.6
@@ -118,7 +118,6 @@ body > .is-root-container,
 .wp-site-blocks > .wp-block-cover,
 .wp-site-blocks > .wp-block-template-part > .wp-block-group.has-background,
 .wp-site-blocks > .wp-block-template-part > .wp-block-cover,
-body > .is-root-container > .wp-block-group.has-background,
 body > .is-root-container > .wp-block-cover,
 body > .is-root-container > .wp-block-template-part > .wp-block-group.has-background,
 body > .is-root-container > .wp-block-template-part > .wp-block-cover,
@@ -126,6 +125,7 @@ body > .is-root-container > .wp-block-template-part > .wp-block-cover,
 	margin-left: calc(-1 * var(--wp--custom--spacing--outer)) !important;
 	margin-right: calc(-1 * var(--wp--custom--spacing--outer)) !important;
 	width: unset;
+	max-width: unset;
 }
 
 /* Blocks inside columns don't have negative margins. */

+ 12 - 19
livro/templates/archive.html

@@ -1,33 +1,26 @@
 <!-- wp:template-part {"slug":"header","tagName":"header"} /-->
 
-<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"inherit":true},"tagName":"main"} -->
-<main class="wp-block-query"><!-- wp:query-title {"type":"archive","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4rem)"},"spacing":{"margin":{"bottom":"6rem"}}}} /-->
-
-<!-- wp:post-template -->
+<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"tagName":"main"} -->
+<main class="wp-block-query">
 <!-- wp:group {"layout":{"inherit":true}} -->
-<div class="wp-block-group"><!-- wp:post-title {"isLink":true} /-->
-
-<!-- wp:post-date {"isLink":true,"format":"F jS, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /-->
-
-<!-- wp:spacer {"height":1} -->
-<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer -->
-
-<!-- wp:post-content /-->
-
-<!-- wp:spacer {"height":112} -->
-<div style="height:112px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer --></div>
+<div class="wp-block-group"><!-- wp:query-title {"type":"archive","style":{"typography":{"fontSize":"clamp(3rem, 6vw, 4rem)"},"spacing":{"margin":{"bottom":"6rem"}}}} /--></div>
 <!-- /wp:group -->
+<!-- wp:post-template -->
+<!-- wp:template-part {"slug":"post"} /-->
 <!-- /wp:post-template -->
 
+<!-- wp:group {"layout":{"inherit":true}} -->
+<div class="wp-block-group">
 <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
 <!-- wp:query-pagination-previous {"fontSize":"small"} /-->
-
 <!-- wp:query-pagination-numbers /-->
-
 <!-- wp:query-pagination-next {"fontSize":"small"} /-->
 <!-- /wp:query-pagination --></main>
 <!-- /wp:query -->
+</div>
+<!-- /wp:group -->
+
+</main>
+<!-- /wp:query -->
 
 <!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

+ 6 - 18
livro/templates/home.html

@@ -1,31 +1,19 @@
 <!-- wp:template-part {"slug":"header","tagName":"header"} /-->
 
-<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"inherit":true},"tagName":"main"} -->
+<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"tagName":"main"} -->
 <main class="wp-block-query"><!-- wp:post-template -->
-<!-- wp:group {"layout":{"inherit":true}} -->
-<div class="wp-block-group"><!-- wp:post-title {"isLink":true} /-->
-
-<!-- wp:post-date {"isLink":true,"format":"F jS, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /-->
-
-<!-- wp:spacer {"height":1} -->
-<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer -->
-
-<!-- wp:post-content /-->
-
-<!-- wp:spacer {"height":112} -->
-<div style="height:112px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer --></div>
-<!-- /wp:group -->
+<!-- wp:template-part {"slug":"post"} /-->
 <!-- /wp:post-template -->
 
+<!-- wp:group {"layout":{"inherit":true}} -->
+<div class="wp-block-group">
 <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
 <!-- wp:query-pagination-previous {"fontSize":"small"} /-->
-
 <!-- wp:query-pagination-numbers /-->
-
 <!-- wp:query-pagination-next {"fontSize":"small"} /-->
 <!-- /wp:query-pagination --></main>
 <!-- /wp:query -->
+</div>
+<!-- /wp:group -->
 
 <!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

+ 9 - 18
livro/templates/index.html

@@ -1,31 +1,22 @@
 <!-- wp:template-part {"slug":"header","tagName":"header"} /-->
 
-<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"inherit":true},"tagName":"main"} -->
+<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"tagName":"main"} -->
 <main class="wp-block-query"><!-- wp:post-template -->
-<!-- wp:group {"layout":{"inherit":true}} -->
-<div class="wp-block-group"><!-- wp:post-title {"isLink":true} /-->
-
-<!-- wp:post-date {"isLink":true,"format":"F jS, Y","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /-->
-
-<!-- wp:spacer {"height":1} -->
-<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer -->
-
-<!-- wp:post-content /-->
-
-<!-- wp:spacer {"height":112} -->
-<div style="height:112px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer --></div>
-<!-- /wp:group -->
+<!-- wp:template-part {"slug":"post"} /-->
 <!-- /wp:post-template -->
 
+<!-- wp:group {"layout":{"inherit":true}} -->
+<div class="wp-block-group">
 <!-- wp:query-pagination {"paginationArrow":"arrow","align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
 <!-- wp:query-pagination-previous {"fontSize":"small"} /-->
-
 <!-- wp:query-pagination-numbers /-->
-
 <!-- wp:query-pagination-next {"fontSize":"small"} /-->
 <!-- /wp:query-pagination --></main>
 <!-- /wp:query -->
+</div>
+<!-- /wp:group -->
+
+</main>
+<!-- /wp:query -->
 
 <!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->

+ 0 - 4
livro/templates/single.html

@@ -6,10 +6,6 @@
 
 <!-- wp:post-date {"format":"F jS, Y","isLink":true,"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /-->
 
-<!-- wp:spacer {"height":1} -->
-<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
-<!-- /wp:spacer -->
-
 <!-- wp:post-featured-image {"align":"wide","style":{"spacing":{"margin":{"bottom":"var(--wp--custom--spacing--small, 1.25rem)"}}}} /--></div>
 <!-- /wp:group -->