3ev / wordpress-starter
3ev's WordPress starter kit
Installs: 60
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.3.2
- 3ev/phingy: ~0.8
- 3ev/wordpress-starter-theme: ~0.1.3
- fancyguy/webroot-installer: ~1.1
- vlucas/phpdotenv: ~1.0
- wordpress: 4.0
- wp-cli/wp-cli: ~0.17
This package is not auto-updated.
Last update: 2024-11-09 17:03:47 UTC
README
A modern Wordpress environment
This is the base WordPress environment that we use at 3ev. It borrows heavily from many of the ideas in the excellent Bedrock project.
What's included?
Tools and Setup
- Dependency management with Composer
- Configuration management with Phpdotenv
- A modern folder structure
- WP CLI command line tools
- Modern plugin and theme development with Wordpress Core
- A frontend workflow using Gulp, Sass and Browserify
- Phingy for build scripts and database management
Wordpress Plugins
Requirements
- PHP
>=5.5.9
- Composer
- Node.js
- Ruby/Rubygems/Bundler if you want to use Capistrano deployments
Installation
$ composer create-project 3ev/wordpress-starter -s dev
$ cd wordpress-starter/
$ bin/init
This will install dependencies, prompt you for any configuration, compile assets, install Wordpress and start your site running on Apache.
Building from an existing site
Once you've setup your WordPress site, you can easily create new builds for development or production. First, dump out your database with:
$ bin/phing db:structure:dump
$ bin/phing db:data:dump
and push to S3 to distribute the files, then all developers have to do is:
$ git clone git@github.com:you/your-wordpress.git my-wordpress-site/
$ cd my-wordpress-site/
$ bin/build
to get a working copy of your site.
Frontend Workflow
Wordpress Starter comes with a single theme, "3ev Starter Wordpress Theme" (public/app/themes/starter/
), which is ready
to use.
This theme includes the following:
- Bootstrap
v4-alpha-2
(via NPM) - jQuery
v2.2.2
(via CDN) - Modernzir
v3
with touch detection andmq
API (included in this repo)
Where possible, you should always try to use NPM to install frontend packages. They're bundled with Browserify, and you
can use Browserify Shim (configure at public/app/themes/starter/assets/js/shim.js
) to bundle any incompatible libraries.
Wordpress Starter includes some Gulp tasks to make it easy to compile your assets. These are run automatically when building locally or deploying with Capistrano.
# Compile JS from `public/app/themes/starter/assets/js/main.js`
$ node_modules/.bin/gulp build:js
# Compile Sass from `public/app/themes/starter/assets/css/main.sass`
$ node_modules/.bin/gulp build:css
You can also compile all assets or watch for changes during development - just use gulp -T
to see all available tasks.
Deploying with Capistrano
Capistrano comes setup and ready to go with this project to make deployment as straightforward as possible. Just run:
$ bundle install
first.
Next, follow the guides to setting up a deployment user and the initial directory on http://capistranorb.com/. Then,
modify the :application
and :repo_url
settings in config/deploy.rb
and create a stage file in config/deploy/
(the
production.rb
file is there as an example for you to start with).
After that you can deploy your site with a single command:
$ bundle exec cap [stage] deploy
Note: You'll need to setup your database separately after your first deployment.
Deploying a different branch
By default, your master
branch will be deployed, but you can deploy a different branch for testing by setting the
BRANCH
environment variable, like:
$ BRANCH=cool-new-feature bundle exec cap [stage] deploy
License
MIT © 3ev