Skip to content

Commit

Permalink
Merge pull request WordPress#103 from WordPress/add/personal-blog
Browse files Browse the repository at this point in the history
Add templates, patterns, style variations and theme.json changes for "personal blog"

Co-authored-by: carolinan <poena@git.wordpress.org>
Co-authored-by: juanfra <juanfra@git.wordpress.org>
  • Loading branch information
3 people authored Aug 25, 2024
2 parents 18416bc + 6f76852 commit 164be9c
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 32 deletions.
15 changes: 15 additions & 0 deletions patterns/hidden-no-results.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* Title: No results
* Slug: twentytwentyfive/hidden-no-results
* Inserter: no
*
* @package WordPress
* @subpackage Twenty_Twenty_Five
* @since Twenty Twenty-Five 1.0
*/

?>
<!-- wp:paragraph -->
<p><?php echo esc_html_x( 'No posts were found.', 'Message explaining that there are no results returned from a search', 'twentytwentyfive' ); ?></p>
<!-- /wp:paragraph -->
24 changes: 24 additions & 0 deletions patterns/post-navigation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Title: Post navigation
* Slug: twentytwentyfive/post-navigation
* Categories: text
* Description: Next and previous post links.
* Block Types: core/post-navigation-link
*
* @package WordPress
* @subpackage Twenty_Twenty_Five
* @since Twenty Twenty-Five 1.0
*/

?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|50","left":"var:preset|spacing|50"},"margin":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignfull" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)">
<!-- wp:group {"ariaLabel":"Post navigation","tagName":"nav","align":"full","style":{"border":{"top":{"color":"var:preset|color|opacity-20","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<nav class="wp-block-group alignfull" aria-label="Post navigation" style="border-top-color:var(--wp--preset--color--opacity-20);border-top-width:1px;padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)">
<!-- wp:post-navigation-link {"type":"previous","showTitle":true,"arrow":"arrow"} /-->
<!-- wp:post-navigation-link {"showTitle":true,"arrow":"arrow"} /-->
</nav>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
44 changes: 44 additions & 0 deletions patterns/posts-personal-blog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* Title: List of posts, 1 column
* Slug: twentytwentyfive/posts-personal-blog
* Categories: query
* Block Types: core/query
* Description: A list of posts, 1 column, with featured image and post date.
*
* @package WordPress
* @subpackage Twenty_Twenty_Five
* @since Twenty Twenty-Five 1.0
*/

?>
<!-- wp:query {"query":{"perPage":3,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[]},"align":"full","layout":{"type":"default"}} -->
<div class="wp-block-query alignfull">
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:query-no-results -->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-no-results"} /-->
<!-- /wp:query-no-results -->
</div>
<!-- /wp:group -->
<!-- wp:post-template {"align":"full","layout":{"type":"default"}} -->
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-featured-image {"isLink":true,"aspectRatio":"3/2"} /-->
<!-- wp:post-title {"isLink":true,"fontSize":"large"} /-->
<!-- wp:post-content {"align":"full","fontSize":"small","layout":{"type":"constrained"}} /-->
<!-- wp:post-date {"isLink":true,"style":{"spacing":{"margin":{"top":"var:preset|spacing|40"}}},"fontSize":"x-small"} /-->
</div>
<!-- /wp:group -->
<!-- /wp:post-template -->
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|50","left":"var:preset|spacing|50"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignfull" style="padding-right:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)">
<!-- wp:query-pagination {"paginationArrow":"arrow","align":"full","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->
<!-- wp:query-pagination-numbers /-->
<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:query -->
30 changes: 30 additions & 0 deletions styles/blocks/post-terms-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": 3,
"$schema": "https://schemas.wp.org/trunk/theme.json",
"title": "Pill shaped",
"slug": "post-terms-1",
"blockTypes": ["core/post-terms"],
"styles": {
"elements": {
"link": {
"border": {
"color": "var:preset|color|opacity-20",
"radius": "20px",
"width": "0.8px",
"style": "solid"
},
"spacing": {
"padding": {
"top": "5px",
"right": "10px",
"bottom": "5px",
"left": "10px"
}
},
"typography": {
"fontWeight": "400"
}
}
}
}
}
11 changes: 11 additions & 0 deletions templates/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:query-title {"type":"archive"} /-->
<!-- wp:term-description /-->
<!-- wp:pattern {"slug":"twentytwentyfive/posts-personal-blog"} /-->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
14 changes: 14 additions & 0 deletions templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:heading {"level":1,"fontSize":"x-large"} -->
<h1 class="wp-block-heading has-x-large-font-size">Blog</h1>
<!-- /wp:heading -->

<!-- wp:pattern {"slug":"twentytwentyfive/posts-personal-blog"} /-->

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

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
38 changes: 8 additions & 30 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:query {"tagName":"main","layout":{"inherit":true}} -->
<main class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"isLink":true} /-->
<!-- wp:post-featured-image {"isLink":true} /-->
<!-- wp:post-content /-->
<!-- wp:group {"layout":{"type":"flex"}} -->
<div class="wp-block-group">
<!-- wp:post-author {"showAvatar":false,"showBio":false} /-->
<!-- wp:post-date {"isLink":true} /-->
<!-- wp:post-terms {"term":"category"} /-->
<!-- wp:post-terms {"term":"post_tag"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
<!-- /wp:post-template -->
<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous /-->
<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:heading {"level":1,"fontSize":"x-large"} -->
<h1 class="wp-block-heading has-x-large-font-size">Blog</h1>
<!-- /wp:heading -->

<!-- wp:query-pagination-numbers /-->
<!-- wp:pattern {"slug":"twentytwentyfive/posts-personal-blog"} /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
</div>
<!-- /wp:group -->
</main>
<!-- /wp:query -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
15 changes: 15 additions & 0 deletions templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-featured-image {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|60"}}}} /-->
<!-- wp:post-title {"level":1,"fontSize":"x-large"} /-->
<!-- wp:post-content {"align":"full","layout":{"type":"constrained"}} /-->
</div>
<!-- /wp:group -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
11 changes: 11 additions & 0 deletions templates/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:query-title {"type":"search"} /-->
<!-- wp:search {"label":"Search","showLabel":false,"buttonText":"Search","style":{"border":{"radius":"50px"}},"fontSize":"small"} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/posts-personal-blog"} /-->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
44 changes: 44 additions & 0 deletions templates/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--60)">
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-terms {"term":"category"} /-->
<!-- wp:post-title {"level":1,"fontSize":"x-large"} /-->
<!-- wp:post-featured-image {"aspectRatio":"3/2"} /-->

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|10","margin":{"bottom":"var:preset|spacing|60"}}},"fontSize":"x-small","layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group has-x-small-font-size" style="margin-bottom:var(--wp--preset--spacing--60)">
<!-- wp:paragraph {"textColor":"primary"} -->
<p class="has-primary-color has-text-color">Written by </p>
<!-- /wp:paragraph -->
<!-- wp:post-author-name {"isLink":true} /-->
</div>
<!-- /wp:group -->

<!-- wp:post-content {"align":"full","layout":{"type":"constrained"}} /-->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:post-terms {"term":"post_tag","separator":" ","className":"is-style-post-terms-1"} /-->
</div>
<!-- /wp:group -->

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|50","left":"var:preset|spacing|50"},"margin":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignfull" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)">
<!-- wp:group {"ariaLabel":"Posts navigation","tagName":"nav","align":"full","style":{"border":{"top":{"color":"var:preset|color|contrast","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<nav class="wp-block-group alignfull" aria-label="Posts navigation" style="border-top-color:var(--wp--preset--color--contrast);border-top-width:1px;padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)">
<!-- wp:post-navigation-link {"type":"previous","showTitle":true,"arrow":"arrow"} /-->
<!-- wp:post-navigation-link {"showTitle":true,"arrow":"arrow"} /-->
</nav>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

</div>
<!-- /wp:group -->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
63 changes: 61 additions & 2 deletions theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -977,15 +977,60 @@
},
"elements": {
"link": {
"color" : {
"color" : {
"text": "var:preset|color|primary"
},
":hover": {
"typography": {
"textDecoration": "underline"
}
},
"typography": {
"textDecoration": "none"
}
}
},
"typography": {
"fontSize": "var:preset|font-size|small"
}
},
"core/post-navigation-link": {
"typography": {
"fontSize": "var:preset|font-size|small"
}
},
"core/post-terms": {
"typography": {
"fontSize": "var:preset|font-size|x-small",
"fontWeight": "600"
},
"elements": {
"link": {
"typography": {
"textDecoration": "none"
},
":hover": {
"typography": {
"textDecoration": "underline"
}
}
}
}
},
"core/post-title": {
"elements": {
"link": {
":hover": {
"typography": {
"textDecoration": "underline"
}
},
"typography": {
"textDecoration": "none"
}
}
}
},
"core/pullquote": {
"typography": {
"fontSize": "var:preset|font-size|x-large",
Expand All @@ -995,6 +1040,17 @@
"lineHeight": "1.2"
}
},
"core/query-pagination": {
"typography": {
"fontSize": "var:preset|font-size|small",
"fontWeight": "500"
}
},
"core/query-title":{
"typography": {
"fontSize": "var:preset|font-size|x-large"
}
},
"core/search": {
"typography": {
"fontSize": "var:preset|font-size|medium",
Expand Down Expand Up @@ -1027,7 +1083,10 @@
},
"core/term-description": {
"color":{
"text": "var:preset|color|primary"
"text":"var:preset|color|primary"
},
"typography": {
"fontSize": "var:preset|font-size|small"
}
},
"core/navigation": {
Expand Down

0 comments on commit 164be9c

Please sign in to comment.