Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the missing archive template in Poetry #140

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions poetry/patterns/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<!-- wp:group {"style":{"spacing":{"padding":{"top":"32px","bottom":"64px"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="padding-top:32px;padding-bottom:64px"><!-- wp:group {"style":{"spacing":{"blockGap":"64px"}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:group {"style":{"spacing":{"blockGap":"88px"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:site-title {"level":0,"isLink":false,"style":{"typography":{"fontSize":"24px","fontStyle":"normal","fontWeight":"600"}},"textColor":"custom-text"} /-->
<div class="wp-block-group"><!-- wp:site-title {"level":0,"isLink":false,"style":{"typography":{"fontStyle":"normal","fontWeight":"600"}},"fontSize":"medium"} /-->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the font sizes to use preset values so the pattern works better in other themes too. To do this I updated theme.json with preset values that use the same slugs as core


<!-- wp:group {"style":{"spacing":{"blockGap":"48px"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:heading {"level":1} -->
<h1>Food <br>for thoughts</h1>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed headings from the header since they appear in almost all pages. We may want the h1 to be something else like the title of a page/post or the archive title instead. I used the preset font sizes instead to keep the same styling for the paragraphs

<!-- /wp:heading -->
<div class="wp-block-group"><!-- wp:paragraph {"style":{"typography":{"lineHeight":"0.8"}},"fontSize":"xx-large","fontFamily":"rozha-one"} -->
<p class="has-rozha-one-font-family has-xx-large-font-size" style="line-height:0.8">Food <br>for thoughts</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5>A collection of valuable thoughts by a very egocentric person.</h5>
<!-- /wp:heading --></div>
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.5"}},"fontSize":"medium"} -->
<p class="has-medium-font-size" style="line-height:1.5">A collection of valuable thoughts by a very egocentric person.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->

Expand Down
23 changes: 23 additions & 0 deletions poetry/templates/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- wp:template-part {"slug":"header","area":"header"} /-->

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:query-title {"type":"archive","style":{"spacing":{"padding":{"bottom":"var:preset|spacing|40"}}},"fontSize":"x-large"} /-->

<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true},"layout":{"type":"default"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:post-title {"isLink":true,"style":{"elements":{"link":{"color":{"text":"var:preset|color|custom-text"}}}},"textColor":"custom-text","fontSize":"large"} /-->

<!-- wp:post-featured-image {"isLink":true,"align":"wide"} /-->

<!-- wp:post-excerpt /-->

<!-- wp:separator {"opacity":"css"} -->
<hr class="wp-block-separator has-css-opacity"/>
<!-- /wp:separator -->

<!-- wp:post-date /-->
<!-- /wp:post-template --></div>
<!-- /wp:query --></div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","area":"footer"} /-->
40 changes: 29 additions & 11 deletions poetry/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,33 @@
"fontFamily": "Inter",
"slug": "inter"
}
],
"fontSizes": [
{
"name": "Small",
"size": "1rem",
"slug": "small"
},
{
"name": "Medium",
"size": "1.5rem",
"slug": "medium"
},
{
"name": "Large",
"size": "2.75rem",
"slug": "large"
},
{
"name": "Extra Large",
"size": "5rem",
"slug": "x-large"
},
{
"name": "Extra Extra Large",
"size": "7.5rem",
"slug": "xx-large"
}
]
}
},
Expand All @@ -101,7 +128,7 @@
"h1": {
"typography": {
"fontFamily": "Rozha One",
"fontSize": "120px",
"fontSize": "var(--wp--preset--font-size--xx-large)",
"fontStyle": "normal",
"fontWeight": "400",
"lineHeight": 0.8
Expand All @@ -110,19 +137,10 @@
"h2": {
"typography": {
"fontFamily": "Rozha One",
"fontSize": "80px",
"fontSize": "var(--wp--preset--font-size--x-large)",
"lineHeight": "0.8"
}
},
"h5": {
"typography": {
"fontFamily": "Inter",
"fontSize": "24px",
"fontStyle": "normal",
"fontWeight": "400",
"lineHeight": 1.5
}
},
"heading": {
"typography": {
"fontFamily": "Rozha One"
Expand Down
Loading