This repo is intended to be used as a base template for developers at Together to clone and use to build production websites using NextJS for the frontend + WordPress for the CMS.
Follow these steps to create a new WP instance on WPEngine and setup the NextJS repo.
-
Select "Copy an existing environment to a new site" and use nextwptemplate as the environment to copy
-
Wait for the site to be created
-
Go to
/wp-login.php
and use nextwptemplate details from 1Password -
Update password on your new site for the
together
user and add as new entry to 1Password -
Go to
/wp-admin/options-permalink.php
- Check to see if production site uses trailing slashes / no trailing slashes and update accordingly
- If production site has a resources area and isn't called
/resources/
, update the permalink to whatever they currently use - Don't forget to update resources page slug to match new permalink if changed
-
Go to
/wp-admin/options-general.php
- Update
Site Title
to the company name - Update
Site Address (URL)
tohttp://localhost:3000
- Update
-
Create new repo using nextwptemplate repo as the template
-
Clone to your local machine
-
Delete
/.github/actions/deploy-template-to-wordpress.yml
file and commit. -
Install dependencies
yarn
-
Setup your .env.local file
- Duplicate
.env.local.example
to.env.local
- Update
NEXT_PUBLIC_WORDPRESS_BASE_URL
value to your WordPress installation url
- Duplicate
-
Run the development server
yarn develop
- Take a backup of the CMS
- Go to
/wp-admin/options-general.php
and updateSite Address
to the production site URL - Do a find and replace of the old
Site Address
and replace with production site URL using WP Migrate DB - Ensure robots.txt is set to be indexed