wporg-documentation-2022
wporg-documentation-2022 copied to clipboard
Documentation
The codebase and development environment for WordPress.org/documentation, formerly WordPress.org/support, also called HelpHub.
Development
Prerequisites
- Docker
- Node/npm
- Yarn
- Composer
Setup
-
Set up repo dependencies.
yarn setup:tools -
Build the theme
yarn build:theme -
Start the local environment.
yarn wp-env start -
Run the setup script.
yarn setup:wp -
(optional) There may be times when you want to make changes to the Parent theme and test them with this theme. To do that:
- Clone the Parent repo and follow the setup instructions in its
readme.mdfile. - Create a
.wp-env.override.jsonfile in this repo - Copy the
themessection from.wp-env.jsonand paste it into the override file. You must copy the entire section for it to work, because it won't be merged with.wp-env.json. - Update the path to the Parent theme to the Parent theme folder inside the Parent repository you cloned above.
{ "themes": [ "./source/wp-content/themes/wporg-documentation-2022", "./source/wp-content/themes/wporg-support", "../wporg-parent-2021/source/wp-content/themes/wporg-parent-2021" ] } - Clone the Parent repo and follow the setup instructions in its
-
Visit site at localhost:8888.
-
Log in with username
adminand passwordpassword.
Environment management
These must be run in the project's root folder, not in theme/plugin subfolders.
-
Stop the environment.
arn wp-env stop -
Restart the environment.
arn wp-env start -
Build the theme's CSS & JavaScript
arn build:themeor, automatically build on changes:
arn start:theme -
Reset WordPress to a clean install, and reconfigure. This will nuke all local WordPress content!
arn wp-env clean all arn setup:wp -
SSH into docker container.
arn wp-env run wordpress bash -
Run wp-cli commands. Keep the wp-cli command in quotes so that the flags are passed correctly.
arn wp-env run cli "post list --post_status=publish" -
Update composer dependencies and sync any
repo-toolschanges.arn update:tools -
Run a lighthouse test.
arn lighthouse