WordPress theme for ChinaPower. Developed from the _s starter theme.
- Follow the instructions in the "Install Local" and "Connect Local to WP Engine" sections in this blog post.
- Follow the instructions in the "pull to Local from WP Engine" section to pull the "ChinaPower Staging" Environment to your local machine
- Navigate to the directory where Local created the site: eg
cd /Users/[YOUR NAME]/Local Sites/chinapower/app/public
- Initiate git & add remote origin. This will connect your local directory to the Git Repo and create a local
main
branch synced with the remotemain
branch.
$ git init
$ git remote add origin [email protected]:CSIS-iLab/chinapower_wp.git
$ git fetch origin
$ git checkout origin/main -ft
To begin development, navigate to the theme directory and start npm.
$ cd wp-content/themes/chinapower_wp
$ npm install
$ npm start
GitHub Actions will automatically build & deploy the theme to either the development or staging environment on WPE depending on the settings specified in the deployment workflow.
-
The
WPE_ENVIRONMENT_NAME: ${{ secrets.WPENGINE_DEV_ENV_NAME }}
setting will be deployed to the WPE Development Environment. The Development environment should be used to demo new features to programs. -
The
WPE_ENVIRONMENT_NAME: ${{ secrets.WPENGINE_STAGING_ENV_NAME }}
setting will be deployed to the WPE Staging Environment. Note: The program actively uses their staging site, so it is recommended that you coordinate with the program before pushing changes to this environment. -
We should add a button to the WP Admin for one-click deploy
This will display all available commands, such as running eslint or imagemin independently.
$ npm run
When modifying the code base, always make a new branch. Unless it's necessary to do otherwise, all branches should be created off of main
.
Branches should use the following naming conventions:
Branch type | Name | Example |
---|---|---|
New Feature | feature/<short description of feature> |
feature/header-navigation |
Bug Fixes | bug/<short description of bug> |
bug/mobile-navigation |
Documentation | docs/<short description of documentation being updated> |
docs/readme |
Code clean-up/refactoring | refactor/<short description> |
refactor/apply-linting |
Content Updates | content/<short description of content> |
content/add-new-posts |
Write clear and concise commit messages describing the changes you are making and why. If there are any issues associated with the commit, include the issue # in the commit title.