Skip to content

Commit

Permalink
Theme 2024: Initial commit of new theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ryelle committed Aug 27, 2024
1 parent 50c21b4 commit 512d7ba
Show file tree
Hide file tree
Showing 17 changed files with 318 additions and 4 deletions.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
"scripts": {
"setup:tools": "npm install && composer install && TEXTDOMAIN=wporg-5ftf composer exec update-configs",
"setup:wp": "wp-env run cli bash env/setup.sh",
"build:theme": "npm run build --workspace=wporg-5ftf",
"start:theme": "npm run watch --workspace=wporg-5ftf",
"build:old-theme": "npm run build --workspace=wporg-5ftf",
"start:old-theme": "npm run watch --workspace=wporg-5ftf",
"build:theme": "npm run build --workspace=wporg-5ftf-2024",
"start:theme": "npm run watch --workspace=wporg-5ftf-2024",
"update:tools": "composer update && TEXTDOMAIN=wporg-5ftf composer exec update-configs",
"wp-env": "wp-env",
"lint:php": "composer lint ./themes/wporg-5ftf ./plugins/wporg-5ftf",
"format:php": "composer format ./themes/wporg-5ftf ./plugins/wporg-5ftf",
"lint:php": "composer lint ./themes/wporg-5ftf ./themes/wporg-5ftf-2024 ./plugins/wporg-5ftf",
"format:php": "composer format ./themes/wporg-5ftf ./themes/wporg-5ftf-2024 ./plugins/wporg-5ftf",
"test:php": "wp-env run tests-cli ./wp-content/mu-plugins/vendor/bin/phpunit -c ./wp-content/phpunit.xml.dist"
},
"workspaces": [
Expand Down
32 changes: 32 additions & 0 deletions themes/wporg-5ftf-2024/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace WordPressDotOrg\Theme\FiveForTheFuture_2024;

require_once __DIR__ . '/inc/block-config.php';

/**
* Actions and filters.
*/
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );

/**
* Enqueue scripts and styles.
*/
function enqueue_assets() {
$asset_file = get_theme_file_path( 'build/style/index.asset.php' );
if ( ! file_exists( $asset_file ) ) {
return;
}

// The parent style is registered as `wporg-parent-2021-style`, and will be loaded unless
// explicitly unregistered. We can load any child-theme overrides by declaring the parent
// stylesheet as a dependency.

$metadata = require $asset_file;
wp_enqueue_style(
'wporg-5ftf-2024',
get_theme_file_uri( 'build/style/style-index.css' ),
array( 'wporg-parent-2021-style', 'wporg-global-fonts' ),
$metadata['version']
);
}
47 changes: 47 additions & 0 deletions themes/wporg-5ftf-2024/inc/block-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* Set up configuration for dynamic blocks.
*/

namespace WordPressDotOrg\Theme\FiveForTheFuture_2024\Block_Config;

add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );

/**
* Provide a list of local navigation menus.
*/
function add_site_navigation_menus( $menus ) {
global $wp_query;

$menu = array();

$menu[] = array(
'label' => __( 'For individuals', 'wporg-5ftf' ),
'url' => '/for-individuals/',
);
$menu[] = array(
'label' => __( 'For organizations', 'wporg-5ftf' ),
'url' => '/for-organizations/',
);
$menu[] = array(
'label' => __( 'Handbook', 'wporg-5ftf' ),
'url' => '/handbook/',
);
$menu[] = array(
'label' => __( 'Pledges', 'wporg-5ftf' ),
'url' => '/pledges/',
);
$menu[] = array(
'label' => __( 'Contact', 'wporg-5ftf' ),
'url' => '/contact/',
);
$menu[] = array(
'label' => __( 'My pledges', 'wporg-5ftf' ),
'url' => '/my-pledges/',
'className' => 'has-separator',
);

return array(
'main' => $menu,
);
}
28 changes: 28 additions & 0 deletions themes/wporg-5ftf-2024/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "wporg-5ftf-2024",
"version": "1.0.0",
"description": "",
"author": "WordPress.org",
"license": "GPL-2.0-or-later",
"private": true,
"devDependencies": {
"@wordpress/scripts": "28.6.0"
},
"eslintConfig": {
"extends": "../../.eslintrc.js"
},
"stylelint": {
"extends": "../../.stylelintrc",
"ignoreFiles": [
"**/*.css",
"**/*.css.map"
]
},
"scripts": {
"build": "wp-scripts build --experimental-modules",
"start": "wp-scripts start --experimental-modules",
"lint:js": "wp-scripts lint-js src",
"lint:css": "wp-scripts lint-style src/**/*.scss",
"format": "wp-scripts format src -- --config=../../.prettierrc.js"
}
}
2 changes: 2 additions & 0 deletions themes/wporg-5ftf-2024/parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

<!-- wp:wporg/global-footer /-->
1 change: 1 addition & 0 deletions themes/wporg-5ftf-2024/parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:pattern {"slug":"wporg-5ftf-2024/header"} /-->
39 changes: 39 additions & 0 deletions themes/wporg-5ftf-2024/patterns/header-front-page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Title: Front Page Header
* Slug: wporg-5ftf-2024/header-front-page
* Inserter: no
*/

?>
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /-->

<!-- wp:wporg/local-navigation-bar {"className":"has-display-contents","backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->

<!-- wp:site-title {"level":0,"fontSize":"small","className":"wporg-local-navigation-bar__show-on-scroll"} /-->

<!-- wp:navigation {"menuSlug":"main","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->

<!-- /wp:wporg/local-navigation-bar -->

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"backgroundColor":"charcoal-2","className":"has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"},"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"wrap","verticalAlignment":"bottom"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)">

<!-- wp:site-title {"level":1,"isLink":false,"style":{"typography":{"fontSize":"50px","lineHeight":"1.2"}}} /-->

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"2.3"}},"textColor":"white"} -->
<p class="has-white-color has-text-color" style="line-height:2.3">WordPress fuels more than a third of the web. Are you a part of it?</p>
<!-- /wp:paragraph -->

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

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

<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
31 changes: 31 additions & 0 deletions themes/wporg-5ftf-2024/patterns/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* Title: Header
* Slug: wporg-5ftf-2024/header
* Inserter: no
*/

?>
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /-->

<!-- wp:wporg/local-navigation-bar {"className":"has-display-contents","backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->

<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group has-light-grey-1-color has-text-color">
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /-->

<!-- wp:post-title {"level":0,"fontSize":"small","fontFamily":"inter","className":"wporg-local-navigation-bar__fade-in-scroll"} /-->
</div>
<!-- /wp:group -->

<!-- wp:navigation {"menuSlug":"main","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->

<!-- /wp:wporg/local-navigation-bar -->

<!-- wp:wporg/language-suggest {"align":"full"} -->
<div class="wp-block-wporg-language-suggest alignfull"></div>
<!-- /wp:wporg/language-suggest -->

<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
3 changes: 3 additions & 0 deletions themes/wporg-5ftf-2024/src/style/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"script": "file:./index.js"
}
2 changes: 2 additions & 0 deletions themes/wporg-5ftf-2024/src/style/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Noop, just imports the CSS for webpack.
import './style.scss';
12 changes: 12 additions & 0 deletions themes/wporg-5ftf-2024/src/style/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Note: only add styles here in cases where you can't achieve the style with
* templates or theme.json settings.
*/

/* Add default focus style. */
:where(main) a:where(:not(.wp-element-button,.wp-block-wporg-link-wrapper)):focus,
:where(main) button:where(:not([class*="wp-block-button"])):focus {
outline: none;
border-radius: 2px;
box-shadow: 0 0 0 1.5px currentColor;
}
13 changes: 13 additions & 0 deletions themes/wporg-5ftf-2024/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Theme Name: Five for the Future, 2024
* Theme URI: https://github.com/WordPress/five-for-the-future/
* Author: WordPress.org
* Author URI: https://wordpress.org/
* Description: A block-based child theme for WordPress.org/five/
* Version: 1.0.0
* License: GNU General Public License v2 or later
* Text Domain: wporg-5ftf
* Template: wporg-parent-2021
*/

/* This file is not used. Add CSS to `src/style/*`. */
15 changes: 15 additions & 0 deletions themes/wporg-5ftf-2024/templates/front-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- wp:pattern {"slug":"wporg-5ftf-2024/header-front-page"} /-->

<!-- wp:group {"tagName":"main","layout":{"type":"constrained"},"className":"entry-content","style":{"spacing":{"blockGap":"0px"}}} -->
<main class="wp-block-group entry-content">

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->

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

<!-- wp:wporg/global-footer /-->
35 changes: 35 additions & 0 deletions themes/wporg-5ftf-2024/templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- wp:template-part {"slug":"header","className":"has-display-contents"} /-->

<!-- wp:group {"tagName":"article","layout":{"inherit":true,"type":"constrained"}} -->
<article class="wp-block-group">
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"top":"0px"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:separator {"align":"full","className":"has-text-color has-light-grey-1-color is-style-wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}}} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity has-text-color has-light-grey-1-color is-style-wide" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)"/>
<!-- /wp:separator -->

<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0px"}}}} -->
<div class="wp-block-group alignfull" style="margin-top:0px">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->
</article>
<!-- /wp:group -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group {"metadata":{"patternName":"wporg-parent-2021/post-navigation","name":"Post Navigation"},"style":{"border":{"top":{"color":"var:preset|color|light-grey-1","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|20","right":"var:preset|spacing|edge-space","bottom":"var:preset|spacing|20","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group" style="border-top-color:var(--wp--preset--color--light-grey-1);border-top-width:1px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-navigation-link {"type":"previous","label":"Previous","showTitle":true,"linkLabel":true} /-->

<!-- wp:post-navigation-link {"label":"Next","showTitle":true,"linkLabel":true} /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer"} /-->
35 changes: 35 additions & 0 deletions themes/wporg-5ftf-2024/templates/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- wp:template-part {"slug":"header","className":"has-display-contents"} /-->

<!-- wp:group {"tagName":"article","layout":{"inherit":true,"type":"constrained"}} -->
<article class="wp-block-group">
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"top":"0px"}}}} /-->
</div>
<!-- /wp:group -->

<!-- wp:separator {"align":"full","className":"has-text-color has-light-grey-1-color is-style-wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}}} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity has-text-color has-light-grey-1-color is-style-wide" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)"/>
<!-- /wp:separator -->

<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0px"}}}} -->
<div class="wp-block-group alignfull" style="margin-top:0px">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->
</article>
<!-- /wp:group -->

<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group {"metadata":{"patternName":"wporg-parent-2021/post-navigation","name":"Post Navigation"},"style":{"border":{"top":{"color":"var:preset|color|light-grey-1","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|20","right":"var:preset|spacing|edge-space","bottom":"var:preset|spacing|20","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group" style="border-top-color:var(--wp--preset--color--light-grey-1);border-top-width:1px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-navigation-link {"type":"previous","label":"Previous","showTitle":true,"linkLabel":true} /-->

<!-- wp:post-navigation-link {"label":"Next","showTitle":true,"linkLabel":true} /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer"} /-->
6 changes: 6 additions & 0 deletions themes/wporg-5ftf-2024/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {},
"styles": {}
}

0 comments on commit 512d7ba

Please sign in to comment.