Skip to content

joannaong/wordflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordflow

Wordpress workflow that generates a static site.

This workflow uses wordpress as a CMS and generates a static site which can be pushed up to S3.

Requirements

Install Composer: https://getcomposer.org/doc/00-intro.md

curl -sS https://getcomposer.org/installer | php

Install NPM

curl http://npmjs.org/install.sh | sh

Structure

PROJECT/
	|- composer.json        # list of php dependencies (composer packages)
	|- composer.lock        # lock file auto_produced when running 'composer install'
	|- gulpfile.js         # gulp tasks
	|- node_modules/        # list of npm dependencies used in gulp (git ignored)
	|- package.json         # list of npm packages
	|- README.md
	|- src/                 # source code (themes and/or plugins)
	|  |- cms/
	|  |  |- plugins/
	|  |  |- themes/
	|  |  `- wp-config.php
	|  |- html/             # front-end files
	|- vendor/              # composer dependencies (git ignored)
	|- wordpress_module/    # wordpress (git ignored)

Usage

Install dependencies

Run 'composer install' in terminal to install wordpress and all dependent plugins and themes. Configuration can be edited inside composer.json. Refer to http://roots.io/using-composer-with-wordpress/ for more info on how it's set up.

composer install

Run 'npm install' in terminal to install node_modules/.

npm install

Setup Wordpress

Setup your database table, database passoword and user. If you're using MAMP, its usually located at http://localhost/phpmyadmin.

Fill in src/cms/wp-config.php with the credentials you used for the database.

/** The name of the database for WordPress */
define('DB_NAME', '*************');

/** MySQL database username */
define('DB_USER', '*************');

/** MySQL database password */
define('DB_PASSWORD', '*************');

/** MySQL hostname */
define('DB_HOST', '*************');

Set up path where Wordpress will be hosted

define('WP_HOME','http://localhost/wordflow/dist');
define('WP_SITEURL','http://localhost/wordflow/dist');

Setup your aws credentials (if applicable)

define('AWS_ACCESS_KEY_ID', '*************');
define('AWS_SECRET_ACCESS_KEY', '*************');

Activate Plugins

  • Go to the dist folder where Wordpress is copied over, ie. http://localhost/wordflow/dist/wp-admin and activate all plugins by going to 'Plugins' on the side dashboard.
  • Go to 'Settings' > 'JSON API' and activate wordflow

Build

Run 'gulp' to build.

  • Wordpress core will be copied over to dist/[env]/
  • src/cms/wp-config.php will be copied over to dist/[env]/wp-config.php
  • src/cms/plugins will be copied over to dist/[env]/wp-content/plugins
gulp

Watch

Run 'gulp' while developing themes and plugins inside src/cms

  • src/cms/wp-config.php will be copied over to dist/[env]/wp-config.php
  • src/cms/plugins will be copied over to dist/[env]/wp-content/plugins
gulp

Plugins

###JSON API

###Advanced Custom Fields

Reference

Tutorials:

Wordpress plugin list:

Notes

MAMP is weird. If you're getting an error when hitting .sh script, fix mamp by opening /Applications/MAMP/Library/bin/envvars and comment out

# DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
# export DYLD_LIBRARY_PATH

About

Wordpress workflow that generates a static site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published