Skip to content

Commit

Permalink
Rename Query pattern, add Posts Grid pattern. Closes #144
Browse files Browse the repository at this point in the history
  • Loading branch information
bgardner committed Aug 16, 2023
1 parent 62deb1a commit 16a0b54
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
34 changes: 34 additions & 0 deletions patterns/posts-grid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Title: Grid of posts in three columns.
* Slug: frost/posts-grid
* Categories: posts
* Block Types: core/query
*/
?>
<!-- wp:query {"queryId":0,"query":{"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"perPage":"10"},"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-query alignwide">
<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|small"}},"layout":{"type":"grid","columnCount":3}} -->
<!-- wp:post-featured-image {"isLink":true,"aspectRatio":"16/9"} /-->
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|x-small","margin":{"top":"30px"}}}} -->
<div class="wp-block-group" style="margin-top:30px">
<!-- wp:post-title {"isLink":true,"fontSize":"large"} /-->
<!-- wp:group {"style":{"spacing":{"blockGap":"5px","margin":{"top":"10px"}}},"layout":{"type":"flex"},"fontSize":"x-small"} -->
<div class="wp-block-group has-x-small-font-size" style="margin-top:10px">
<!-- wp:post-date /-->
<!-- wp:paragraph -->
<p>·</p>
<!-- /wp:paragraph -->
<!-- wp:post-author-name {"isLink":true} /-->
</div>
<!-- /wp:group -->
<!-- wp:post-excerpt {"moreText":"Read More →","excerptLength":20,"fontSize":"small"} /-->
</div>
<!-- /wp:group -->
<!-- /wp:post-template -->
<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous /-->
<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
</div>
<!-- /wp:query -->
5 changes: 3 additions & 2 deletions patterns/query.php → patterns/posts.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
/**
* Title: List of posts in one column.
* Slug: frost/query
* Inserter: false
* Slug: frost/posts
* Categories: posts
* Block Types: core/query
*/
?>
<!-- wp:query {"queryId":0,"query":{"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"type":"constrained"}} -->
Expand Down
2 changes: 1 addition & 1 deletion templates/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- wp:term-description /-->
</div>
<!-- /wp:group -->
<!-- wp:pattern {"slug":"frost/query"} /-->
<!-- wp:pattern {"slug":"frost/posts"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer"} /-->
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header"} /-->
<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0"},"padding":{"top":"40px","bottom":"40px"}}},"className":"site-content"} -->
<main class="wp-block-group site-content" style="margin-top:0;padding-top:40px;padding-bottom:40px">
<!-- wp:pattern {"slug":"frost/query"} /-->
<!-- wp:pattern {"slug":"frost/posts"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer"} /-->
2 changes: 1 addition & 1 deletion templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- wp:query-title {"type":"search","fontSize":"large"} /-->
</div>
<!-- /wp:group -->
<!-- wp:pattern {"slug":"frost/query"} /-->
<!-- wp:pattern {"slug":"frost/posts"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer"} /-->

0 comments on commit 16a0b54

Please sign in to comment.