Skip to content

Commit

Permalink
Enable global header block foundation (#20)
Browse files Browse the repository at this point in the history
This just adds the foundation for the blocks, the actual content will be added in future commits to `wporg-mu-plugins`.
  • Loading branch information
iandunn authored Aug 27, 2021
1 parent 7241d17 commit 4e1695f
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 68 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ wp-cli.yml

# Allow local environment overrides.
.wp-env.override.json
.env/0-sandbox.php

# Configs from wporg-repo-tools.
.eslintrc.js
Expand All @@ -21,6 +20,9 @@ phpcs.xml.dist
/source/wp-content/*
/source/wp-content/themes/*

# `.env/0-sandbox.php` is tracked, so these files can contain local tweaks that shouldn't be tracked.
/source/wp-content/mu-plugins/sandbox-*.php

# ...except the actual source of this project.
!/source/wp-content/themes
!/source/wp-content/themes/wporg-news-2021
7 changes: 5 additions & 2 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"FS_METHOD": "direct",
"WP_ENVIRONMENT_TYPE": "local",
"JETPACK_DEV_DEBUG": true,
"WPORG_SANDBOXED": true
"WPORG_SANDBOXED": true,
"WPORG_GIT_MUPLUGINS_DIR": "/var/www/html/vendor/wporg/wporg-mu-plugins/mu-plugins"
},
"core": "WordPress/WordPress#5.8",
"plugins": [
Expand All @@ -20,6 +21,8 @@
"./source/wp-content/themes/wporg-news-2021"
],
"mappings": {
"env": "./env"
"env": "./env",
"wp-content/mu-plugins/0-sandbox.php": "./env/0-sandbox.php",
"vendor/wporg": "./vendor/wporg"

This comment has been minimized.

Copy link
@coreymckrill

coreymckrill Sep 7, 2021

Contributor

@iandunn were the env and vendor/wporg directories added for something specific, or was it just pre-emptive? I'm not seeing anything they're currently being used for...

This comment has been minimized.

Copy link
@coreymckrill

coreymckrill Sep 7, 2021

Contributor

Er, just vendor/wporg actually. I added env earlier for the import script, duh.

This comment has been minimized.

Copy link
@iandunn

iandunn Sep 7, 2021

Author Member

🤔 , i think that was so that wporg-mu-plugins would be installed inside the container. I later switched to using composer to install it there, so i think this can be removed. i'll do that

This comment has been minimized.

Copy link
@iandunn

iandunn Sep 7, 2021

Author Member

Done in d83ae44

}
}
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
{
"type": "vcs",
"url": "[email protected]:WordPress/wporg-repo-tools.git"
},
{
"type": "vcs",
"url": "[email protected]:WordPress/wporg-mu-plugins.git"
}
],
"require": {},
Expand All @@ -37,6 +41,7 @@
"wpackagist-plugin/syntaxhighlighter": "*",
"wpackagist-plugin/wordpress-importer": "*",
"wporg/wporg-repo-tools": "dev-trunk",
"wordpress/wporg-mu-plugins": "dev-trunk",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"wp-coding-standards/wpcs": "2.*",
"phpcompatibility/phpcompatibility-wp": "*",
Expand Down
11 changes: 11 additions & 0 deletions env/0-sandbox.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

/*
* These are stubs for closed source code, or things that only apply to local environments.
*/

namespace WordPress_org\News_2021\Stubs;

defined( 'WPINC' ) || die();

require_once WPORG_GIT_MUPLUGINS_DIR . '/blocks/global-header-footer/blocks.php';
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ This is starting as a fork of [Blockbase](https://github.com/Automattic/themes/t

### Environment management

These must be run in the project's root folder, _not_ in theme/plugin subfolders.

* Stop the environment: `yarn run env:stop` or `yarn run wp-env stop`
* Restart the environment: `yarn run env` or `yarn run wp-env start`
* Reset the dev site's content: `yarn run env:reset && yarn run env:import`
* SSH into docker container: `docker exec -it {container ID} /bin/bash`. You can get the ID from `docker ps`.

### Asset management

Expand Down
18 changes: 0 additions & 18 deletions source/wp-content/themes/wporg-news-2021/404.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:paragraph {"align":"center","fontSize":"tiny"} -->
<p class="has-text-align-center has-tiny-font-size">Proudly Powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
<!-- wp:wporg/global-footer /-->
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"bottom":"40px"}}},"className":"site-header"} -->
<div class="wp-block-group alignfull site-header" style="padding-bottom:40px">
<!-- wp:site-title /-->
<!-- wp:navigation {"isResponsive":true,"__unstableLocation":"primary"} /-->
</div>
<!-- /wp:group -->
<!-- wp:wporg/global-header /-->
11 changes: 0 additions & 11 deletions source/wp-content/themes/wporg-news-2021/footer.php

This file was deleted.

5 changes: 2 additions & 3 deletions source/wp-content/themes/wporg-news-2021/functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace WordPressdotorg\Theme\News;
namespace WordPressdotorg\Theme\News_2021;

/**
* Actions and filters.
Expand Down Expand Up @@ -41,7 +41,6 @@ function theme_support() {
'primary' => __( 'Primary Navigation', 'wporg' ),
)
);

}

/**
Expand Down Expand Up @@ -69,7 +68,7 @@ function enqueue_assets() {
/**
* Add Google webfonts.
*
* @return $fonts_url
* @return string $fonts_url
*/
function fonts_url() {
if ( ! class_exists( '\WP_Theme_JSON_Resolver_Gutenberg' ) ) {
Expand Down
18 changes: 0 additions & 18 deletions source/wp-content/themes/wporg-news-2021/header.php

This file was deleted.

2 changes: 0 additions & 2 deletions source/wp-content/themes/wporg-news-2021/index.php

This file was deleted.

0 comments on commit 4e1695f

Please sign in to comment.