This is a static version of the WordCamp Seattle 2019 site, to make it easy to collaborate on the content and custom CSS before the site is launched. This avoids having to share database dumps, or setup a shared remote staging site.
If you're starting from scratch, the Alternative Approach
described below might work better than the one described here.
git clone https://github.com/iandunn/wordcamp-seattle-2019.git
npm install
- Send the Git repo owner your GitHub username, so they can add you to the team, allowing you to
push
changes - Install the LiveReload browser extension, so you don't have to refresh manually. Firefox, Chrome.
git pull
npm start
: Run the linter and build the CSS file, watching scss files for changes. Also turns on the livereload server.- Load the
index.php
file in your browser, with apage
param that matches the content template. e.g.,index.php?page=front-page
. - Edit the SCSS files to match the mockup.
npm run lint
and fix any violations.npm run build
to get a final CSS file suitable for production.- @todo this may not be needed since
wordcamp-remote-css
will minify, but confirm that.
- @todo this may not be needed since
git commit
git pull --rebase
git push
- Setup a fresh WP site locally
- Delete the wp-content folder
- Download and extract https://github.com/WordPress/wordcamp.org/archive/production.zip
- Move the wordcamp.org
wp-content
folder into your local installation - Activate the CampSite 2017 theme and all the plugins.
- Setup the basic content elements for the area you want to work on: menus, widgets, etc. The content inside them can be placeholders, you just need the containers to match what will eventually be on production. CampSite 2017 provides lots of widget areas that can be helpful, especially with the Custom HTML widget.
- Open the front end of the site, view-source, and copy-paste the relevant parts into the corresponding static HTML page in
template-parts/
.
When you're ready to launch:
- Turn on Coming Soon mode, so visitors don't see the site in transition
- Switch to the CampSite 2017 theme
- Configure Remote CSS to point to the built
style.css
file in the GitHub repo - Create nav menus, widgets, etc to match what's in the static HTML files
- use the Additional CSS panel in the Custmoizers to quickly/easily make any tweaks that are needed
- Setup the webhook so that pushing changes to the Git repo automatically deploy them to the production site (see Remote CSS on-screen help).
- Move the Additional CSS tweaks to the Git repo so that everything is in one place and consistent.
- Turn off Coming Soon mode
- Can get rid of custom .stylelintrc.json and just rely on wp coding standard plugin?
- Fix any
@todo
notes throughout the repo.
With this method, the production site still looks nice during development, but there's much less work transferring content between local and production.
- Clone another WordCamp site that's using the theme you want to use.
- Setup your header/footer/sidbar content on production.
- View the HTML source of the homepage, and save that to a
.html
file in this folder. - Change the URL to the CSS file to be the local file here.
- Once you've finished implementing the design locally, remove the cloned theme's custom CSS and setup this stylesheet as the Remote CSS URL.
This approach works well if you've already turned off Coming Soon mode, so that you can start publishing posts.
If you have time to develop on the production site instead, then that's probably easier than doing this.
For other ideas, check out the handbook.
This might not be needed in the future if some improvements are made to the Coming Soon feature.
This borrows a lot of tooling etc from wcus/wcus-2019, props @ryelle et al.