Skip to content

Commit

Permalink
Post List: Move to pattern so that strings can be translated
Browse files Browse the repository at this point in the history
See #121
  • Loading branch information
ryelle committed Jan 22, 2024
1 parent 63453a6 commit b6ca464
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 30 deletions.
31 changes: 1 addition & 30 deletions source/wp-content/themes/wporg-parent-2021/parts/post-list.html
Original file line number Diff line number Diff line change
@@ -1,30 +1 @@
<!-- wp:query {"tagName":"main"} -->
<main class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:group {"tagName":"header","className":"entry-header"} -->
<header class="wp-block-group entry-header">
<!-- wp:post-title {"level":2,"isLink":true,"fontSize":"heading-3"} /-->

<!-- wp:group {"className":"entry-meta"} -->
<div class="wp-block-group entry-meta">
<!-- wp:post-date /-->
</div>
<!-- /wp:group -->
</header>
<!-- /wp:group -->

<!-- wp:group {"tagName":"section","style":{"spacing":{"bottom":{"top":"var:preset|spacing|60"}}}} -->
<section class="wp-block-group" style="margin-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-excerpt {"moreText":"Read Post","showMoreOnNewLine":true,"layout":{"inherit":true}} /-->
</section>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous {"label":"Newer Posts"} /-->
<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-next {"label":"Older Posts"} /-->
<!-- /wp:query-pagination -->

</main>
<!-- /wp:query -->
<!-- wp:pattern {"slug":"wporg-parent-2021/post-list"} /-->
38 changes: 38 additions & 0 deletions source/wp-content/themes/wporg-parent-2021/patterns/post-list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Title: Post List
* Slug: wporg-parent-2021/post-list
* Categories: wporg
*/

?>
<!-- wp:query {"tagName":"main"} -->
<main class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:group {"tagName":"header","className":"entry-header"} -->
<header class="wp-block-group entry-header">
<!-- wp:post-title {"level":2,"isLink":true,"fontSize":"heading-3"} /-->

<!-- wp:group {"className":"entry-meta"} -->
<div class="wp-block-group entry-meta">
<!-- wp:post-date /-->
</div>
<!-- /wp:group -->
</header>
<!-- /wp:group -->

<!-- wp:group {"tagName":"section","style":{"spacing":{"bottom":{"top":"var:preset|spacing|60"}}}} -->
<section class="wp-block-group" style="margin-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-excerpt {"moreText":"<?php esc_html_e( 'Read Post', 'wporg' ); ?>","showMoreOnNewLine":true,"layout":{"inherit":true}} /-->
</section>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous {"label":"<?php esc_html_e( 'Newer Posts', 'wporg' ); ?>"} /-->
<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-next {"label":"<?php esc_html_e( 'Older Posts', 'wporg' ); ?>"} /-->
<!-- /wp:query-pagination -->

</main>
<!-- /wp:query -->

0 comments on commit b6ca464

Please sign in to comment.