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

Updates to the wporg-events-2023 theme. #1118

Merged
merged 12 commits into from
Dec 1, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function prime_query_cache(): void {
'filter_slug' => FILTER_SLUG,
'start_timestamp' => 0,
'end_timestamp' => 0,
'landing_page' => $request_uri
'landing_page' => $request_uri,
);

$cache_key = Google_Map\get_cache_key( $parts );
Expand Down Expand Up @@ -307,7 +307,7 @@ function get_current_landing_page(): string {
*
* Without this, all city pages would share the same cache key, and the wrong events would show up on most pages.
*/
function add_landing_page_to_cache_key( array $items ) : array {
function add_landing_page_to_cache_key( array $items ): array {
if ( is_city_landing_page() && FILTER_SLUG === $items['filter_slug'] ) {
$items['landing_page'] = get_current_landing_page();
}
Expand Down
21 changes: 2 additions & 19 deletions public_html/wp-content/themes/wporg-events-2023/parts/footer.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|edge-space","bottom":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}},"className":"wporg-events__footer-organize","layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group wporg-events__footer-organize"
style="padding-top:var(--wp--preset--spacing--edge-space);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"70%"}},"fontSize":"heading-4"} -->
<p class="has-heading-4-font-size">If you can't find a WordPress event around your area, you can become an organizer
and start hosting WordPress events.</p>
<!-- /wp:paragraph -->
<!-- wp:pattern {"slug":"wporg-events-2023/community-callout"} /-->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"right"},"style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<div class="wp-block-buttons"><!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button"
href="/organize-an-event/">Become an
organizer</a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:group -->

<!-- wp:wporg/global-footer {"style":"black-on-white"} /-->
<!-- wp:wporg/global-footer {"style":"white-on-blue"} /-->

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Title: Front Page
* Slug: wporg-events-2023/community-callout
* Inserter: no
*/

?>

<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"spacing":{"padding":{"top":"5rem","right":"var:preset|spacing|edge-space","bottom":"5rem","left":"var:preset|spacing|edge-space"}}},"backgroundColor":"blueberry-1","textColor":"white","className":"wporg-events__callout","layout":{"inherit":true,"type":"constrained"}} -->
<div class="wp-block-group alignfull wporg-events__callout has-white-color has-blueberry-1-background-color has-text-color has-background has-link-color" id="get-started" style="padding-top:5rem;padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:5rem;padding-left:var(--wp--preset--spacing--edge-space)"><!-- wp:group {"align":"wide","layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group alignwide"><!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"70%"},"elements":{"link":{"color":{"text":"var:preset|color|white"}}}},"textColor":"white","fontSize":"heading-3","fontFamily":"eb-garamond"} -->
<p class="has-white-color has-text-color has-link-color has-eb-garamond-font-family has-heading-3-font-size">Can't find a WordPress event near you? Become an organizer and start hosting local events where you live today.</p>
<!-- /wp:paragraph -->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"right","orientation":"horizontal"},"style":{"layout":{"selfStretch":"fill","flexSize":null}}} -->
<div class="wp-block-buttons"><!-- wp:button {"className":"has-custom-width is-style-fill-on-dark"} -->
<div class="wp-block-button has-custom-width is-style-fill-on-dark"><a class="wp-block-button__link wp-element-button" href="/organize-an-event/">Learn more</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Title: Front Page Contributors
* Slug: wporg-events-2023/contributors
* Inserter: no
*/

?>

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)"><!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":{"left":"var:preset|spacing|40"}}},"className":"wporg-events__contributors"} -->
<div class="wp-block-columns alignwide wporg-events__contributors"><!-- wp:column {"verticalAlignment":"top","width":"50%","layout":{"type":"default"}} -->
<div class="wp-block-column is-vertically-aligned-top" style="flex-basis:50%"><!-- wp:heading {"style":{"spacing":{"margin":{"top":"0"}}},"className":"is-style-default","fontFamily":"eb-garamond"} -->
<h2 class="wp-block-heading is-style-default has-eb-garamond-font-family" style="margin-top:0">Where all WordPress <em>contributors meet</em></h2>
<!-- /wp:heading -->

<!-- wp:list {"style":{"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|30"}}},"className":"is-style-links-list"} -->
<ul style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--30)" class="is-style-links-list"><!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://central.wordcamp.org">WordCamp Central</a> ↗</li>
<!-- /wp:list-item -->

<!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://meetup.com">Meetup.com</a> ↗</li>
<!-- /wp:list-item -->

<!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://doaction.org">Do_Action hackathons</a> ↗</li>
<!-- /wp:list-item -->

<!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://make.wordpress.org/community/events/">Events in Community blog</a> ↗</li>
<!-- /wp:list-item -->

<!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://make.wordpress.org/community/events/online/">Online events in Community blog</a> ↗</li>
<!-- /wp:list-item -->

<!-- wp:list-item {"fontSize":"medium"} -->
<li class="has-medium-font-size"><a href="https://make.wordpress.org/community/handbook/community-deputy/other-event-formats/nextgen-wordpress-event/">Next
Gen events in Community blog</a> ↗</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"top","width":"50%"} -->
<div class="wp-block-column is-vertically-aligned-top" style="flex-basis:50%"><!-- wp:jetpack/tiled-gallery {"columnWidths":[["65.48121","34.51879"]],"ids":[79,85,82],"style":{"layout":{"selfStretch":"fixed","flexSize":"50%"}}} -->
<div class="wp-block-jetpack-tiled-gallery aligncenter is-style-rectangular"><div class="tiled-gallery__gallery"><div class="tiled-gallery__row"><div class="tiled-gallery__col" style="flex-basis:65.48121%"><figure class="tiled-gallery__item"><img alt="" data-height="272" data-url="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-rectangle1.png" data-width="615" src="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-rectangle1.png" data-amp-layout="responsive"/></figure></div></div><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" data-height="272" data-url="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-square1.png" data-width="298" src="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-square1.png" data-amp-layout="responsive"/></figure></div><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" data-height="272" data-url="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-square2.png" data-width="297" src="https://events.wordpress.test/wp-content/themes/wporg-events-2023/images/contributors-square2.png" data-amp-layout="responsive"/></figure></div></div></div></div>
Copy link
Member

Choose a reason for hiding this comment

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

It looks like copy/pasting from the editor overwrote the inclusion of the front-contributors-meet-gallery.php pattern. I'd set that up in order to generate the URLs dynamically instead of hardcoding local env URLs like this.

I'll fix it in the next PR, but LMK if you have any ideas on how to structure things better so that we don't accidentally do stuff like this. I'm still trying to find a good editor -> code workflow, so I may not have set it up in the best way.

One nice thing about using template parts is that the editor shows them as a part, so it's more obvious that you should just copy/paste that section into a specific file. For patterns it just says "Group" and you have to already know that it's part of a pattern :(

<!-- /wp:jetpack/tiled-gallery --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
54 changes: 54 additions & 0 deletions public_html/wp-content/themes/wporg-events-2023/patterns/cover.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* Title: Front Page Cover
* Slug: wporg-events-2023/cover
* Inserter: no
*/

?>

<!-- wp:group {"className":"alignwide wporg-events__cover","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide wporg-events__cover"><!-- wp:columns {"align":"wide","style":{"spacing":{"margin":{"bottom":"var:preset|spacing|30"}}}} -->
<div class="wp-block-columns alignwide" style="margin-bottom:var(--wp--preset--spacing--30)"><!-- wp:column {"verticalAlignment":"bottom","width":"50%"} -->
<div class="wp-block-column is-vertically-aligned-bottom" style="flex-basis:50%"><!-- wp:heading {"level":1,"style":{"elements":{"link":{"color":{"text":"var:preset|color|charcoal-0"}}},"spacing":{"margin":{"top":"var:preset|spacing|20"}}},"textColor":"charcoal-0","fontSize":"heading-2"} -->
<h1 class="wp-block-heading has-charcoal-0-color has-text-color has-link-color has-heading-2-font-size" style="margin-top:var(--wp--preset--spacing--20)"><em>Meet the community</em> behind WordPress</h1>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fit","flexSize":null},"elements":{"link":{"color":{"text":"var:preset|color|charcoal-0"}}}},"textColor":"charcoal-0"} -->
<p class="has-charcoal-0-color has-text-color has-link-color">All over the world contributors meet to share, learn, and collaborate for the WordPress project.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:wporg/google-map {"id":"all-upcoming-map","apiKey":"WORDCAMP_DEV_GOOGLE_MAPS_API_KEY","filterSlug":"all-upcoming","showList":false,"showSearch":false} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"className":"wporg-events__stats","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignwide wporg-events__stats" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)"><!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":{"left":"var:preset|spacing|30"}}}} -->
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33.34%","fontSize":"medium","fontFamily":"eb-garamond"} -->
<div class="wp-block-column has-eb-garamond-font-family has-medium-font-size" style="flex-basis:33.34%"><!-- wp:group {"style":{"border":{"radius":"2px","width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|30"}}},"borderColor":"light-grey-1","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-border-color has-light-grey-1-border-color" style="border-width:1px;border-radius:2px;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|charcoal-0"}}}},"textColor":"charcoal-0","fontSize":"heading-6"} -->
<p class="has-charcoal-0-color has-text-color has-link-color has-heading-6-font-size">3,925 events this year</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"33.34%","fontSize":"medium","fontFamily":"eb-garamond"} -->
<div class="wp-block-column has-eb-garamond-font-family has-medium-font-size" style="flex-basis:33.34%"><!-- wp:group {"style":{"border":{"radius":"2px","width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|30"}}},"borderColor":"light-grey-1","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-border-color has-light-grey-1-border-color" style="border-width:1px;border-radius:2px;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph {"style":{"layout":{"selfStretch":"fit","flexSize":null},"elements":{"link":{"color":{"text":"var:preset|color|charcoal-0"}}}},"textColor":"charcoal-0","fontSize":"heading-6"} -->
<p class="has-charcoal-0-color has-text-color has-link-color has-heading-6-font-size">108 countries</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:column -->

<!-- wp:column {"width":"33.33%","fontSize":"medium","fontFamily":"eb-garamond"} -->
<div class="wp-block-column has-eb-garamond-font-family has-medium-font-size" style="flex-basis:33.33%"><!-- wp:group {"style":{"border":{"radius":"2px","width":"1px"},"spacing":{"padding":{"left":"var:preset|spacing|30","top":"var:preset|spacing|20","bottom":"var:preset|spacing|20"}}},"borderColor":"light-grey-1","layout":{"type":"constrained"}} -->
<div class="wp-block-group has-border-color has-light-grey-1-border-color" style="border-width:1px;border-radius:2px;padding-top:var(--wp--preset--spacing--20);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--30)"><!-- wp:paragraph {"style":{"layout":{"selfStretch":"fit","flexSize":null},"elements":{"link":{"color":{"text":"var:preset|color|charcoal-0"}}}},"textColor":"charcoal-0","fontSize":"heading-6"} -->
<p class="has-charcoal-0-color has-text-color has-link-color has-heading-6-font-size">540,537 members</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
Loading
Loading