Skip to content

Commit

Permalink
Events: Add front page template
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn committed Nov 16, 2023
1 parent 78bf1fc commit 9bf1089
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 15 deletions.
19 changes: 19 additions & 0 deletions public_html/wp-content/themes/wporg-events-2023/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

add_filter( 'parse_request', __NAMESPACE__ . '\add_city_landing_page_query_vars' );
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );

/**
* Override the current query vars so that the city landing page loads instead.
Expand Down Expand Up @@ -65,3 +66,21 @@ function enqueue_assets() {
filemtime( __DIR__ . '/style.css' )
);
}

/**
* Provide a list of local navigation menus.
*/
function add_site_navigation_menus( $menus ) {
return array(
'local-navigation' => array(
array(
'label' => __( 'All Events', 'wordcamporg' ),
'url' => '/upcoming-events/',
),
array(
'label' => __( 'Organize an Event', 'wordcamporg' ),
'url' => '/organize-an-event/',
),
),
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:wporg/global-footer {"style":"black-on-white"} /-->
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:group {"style":{"layout":{"selfStretch":"fixed","flexSize":"50%"},"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"flex","flexWrap":"nowrap","orientation":"vertical"}} -->
<div class="wp-block-group"
style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:heading {"className":"is-style-default"} -->
<h2 class="wp-block-heading is-style-default">Where all WordPress contributors meet</h2>
<!-- /wp:heading -->

<!-- wp:list {"className":"is-style-links-list"} -->
<ul class="is-style-links-list"><!-- wp:list-item -->
<li><a href="https://central.wordcamp.org">WordCamp Central</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://meetup.com">Meetup.com</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://doaction.org">Do_Action hackathons</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://make.wordpress.org/community/events/">Events in Community blog</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><a href="https://make.wordpress.org/community/events/online/">Online events in Community blog</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li><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:group -->

<!-- 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="615" data-id="79"
data-link="https://events.wordpress.test/olympus-digital-camera/"
data-url="https://events.wordpress.test/files/2023/11/Avenue-A-Strummer-Memorial.jpg"
data-width="820"
src="https://events.wordpress.test/files/2023/11/Avenue-A-Strummer-Memorial.jpg"
data-amp-layout="responsive" /></figure>
</div>
<div class="tiled-gallery__col" style="flex-basis:34.51879%">
<figure class="tiled-gallery__item"><img alt="" data-height="333" data-id="85"
data-link="https://events.wordpress.test/shoes/"
data-url="https://events.wordpress.test/files/2023/11/shoes.jpg" data-width="500"
src="https://events.wordpress.test/files/2023/11/shoes.jpg" data-amp-layout="responsive" />
</figure>
<figure class="tiled-gallery__item"><img alt="" data-height="338" data-id="82"
data-link="https://events.wordpress.test/leaves/"
data-url="https://events.wordpress.test/files/2023/11/leaves.jpg" data-width="450"
src="https://events.wordpress.test/files/2023/11/leaves.jpg" data-amp-layout="responsive" />
</figure>
</div>
</div>
</div>
</div>
<!-- /wp:jetpack/tiled-gallery -->
</div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- wp:group {"className":"entry-content","layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"left"}} -->
<div class="wp-block-group entry-content">
<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|white"}}},"layout":{"selfStretch":"fixed","flexSize":"50%"},"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"}}},"backgroundColor":"charcoal-2","textColor":"white","layout":{"type":"flex","orientation":"vertical","justifyContent":"left","flexWrap":"wrap"}} -->
<div class="wp-block-group has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color"
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:heading {"level":1} -->
<h1 class="wp-block-heading">Meet the community behind WordPress</h1>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fit","flexSize":null}}} -->
<p>All over the world contributors meet to share, learn, and collaborate for the WordPress project.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>286 events this last year</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>35 countries</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>6,052 contributor attendees</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->

<!-- wp:paragraph {"style":{"layout":{"selfStretch":"fixed","flexSize":"50%"}}} -->
<p>map goes here</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- wp:group {"style":{"spacing":{"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group"
style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:heading {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}},"fontSize":"medium"} -->
<h2 class="wp-block-heading has-medium-font-size" style="font-style:normal;font-weight:700">Upcoming Events</h2>
<!-- /wp:heading -->

<!-- wp:wporg/events-landing-page {"events":"all-upcoming"} /-->

<!-- wp:buttons {"style":{"spacing":{"margin":{"top":"var:preset|spacing|40"}}}} -->
<div class="wp-block-buttons" style="margin-top:var(--wp--preset--spacing--40)">
<!-- wp:button {"className":"is-style-outline"} -->
<div class="wp-block-button is-style-outline"><a class="wp-block-button__link wp-element-button">See all
events</a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- 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"}}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"
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":"fill","flexSize":null}},"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:buttons {"style":{"layout":{"selfStretch":"fit","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">Become an
organizer</a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:wporg/global-header {"style":"black-on-white"} /-->

<!-- wp:pattern {"slug":"wporg-events-2023/local-navigation"} /-->
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

?>

<!-- wp:wporg/local-navigation-bar {"backgroundColor":"charcoal-2","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space","top":"16px","bottom":"16px"}},"position":{"type":"sticky"},"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}},"border":{"top":{"color":"var:preset|color|charcoal-3","style":"solid","width":"1px"},"right":{},"bottom":{},"left":{}}},"textColor":"white","fontSize":"small"} -->
<!-- wp:wporg/local-navigation-bar {"backgroundColor":"white","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space","top":"16px","bottom":"16px"}},"position":{"type":"sticky"},"elements":{"link":{"color":{"text":"var:preset|color|charcoal-1"},":hover":{"color":{"text":"var:preset|color|white"}}}},"border":{"top":{"color":"var:preset|color|charcoal-3","style":"solid","width":"1px"},"right":[],"bottom":[],"left":[]}},"textColor":"charcoal-1","fontSize":"small"} -->
<!-- wp:site-title {"level":0,"fontSize":"small"} /-->

<!-- wp:navigation {"ref":7206,"textColor":"white","hasIcon":false,"layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->
<!-- wp:navigation {"icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small","menuSlug":"local-navigation"} /-->
<!-- /wp:wporg/local-navigation-bar -->
6 changes: 3 additions & 3 deletions public_html/wp-content/themes/wporg-events-2023/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Theme Name: Events.WordPress.org 2023
* Theme Name: Events.WordPress.org 2023
* Description: Includes templates for the homepage, event archives, etc.
* License: GNU General Public License v2 or later
* License: GNU General Public License v2 or later
* Text Domain: wporg
* Template: wporg-parent-2021
* Template: wporg-parent-2021
*/
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<!-- wp:wporg/global-header /-->
<!-- wp:template-part {"slug":"header"} /-->

<!-- wp:pattern {"slug":"wporg-events-2023/local-navigation"} /-->

<!-- wp:group {"tagName":"main","className":"entry-content"} -->
<!-- wp:group {"tagName":"main","className":"entry-content","layout":{"type":"default"}} -->
<main class="wp-block-group entry-content">
<!-- wp:wporg/events-landing-page {"events":"all-upcoming"} /-->
<!-- wp:template-part {"slug":"front-page/cover","theme":"wporg-events-2023"} /-->

<!-- wp:template-part {"slug":"front-page/events","theme":"wporg-events-2023"} /-->

<!-- wp:template-part {"slug":"front-page/contributors","theme":"wporg-events-2023"} /-->

<!-- wp:template-part {"slug":"front-page/organize","theme":"wporg-events-2023"} /-->
</main>
<!-- /wp:group -->

<!-- wp:wporg/global-footer /-->
<!-- wp:template-part {"slug":"footer"} /-->
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<!-- wp:wporg/global-header /-->

<!-- wp:pattern {"slug":"wporg-events-2023/local-navigation"} /-->
<!-- wp:template-part {"slug":"header"} /-->

<!-- wp:group {"tagName":"main","className":"entry-content"} -->
<main class="wp-block-group entry-content">
<!-- wp:wporg/events-landing-page {"events":"city"} /-->
</main>
<!-- /wp:group -->

<!-- wp:wporg/global-footer /-->
<!-- wp:template-part {"slug":"footer"} /-->

0 comments on commit 9bf1089

Please sign in to comment.