GithubHelp home page GithubHelp logo

theme-build's Introduction

Building SiteOrigin themes

There are few steps necessary to prepare a theme for release on the WordPress.org plugin directory. We use Gulp to automate this.

Environment setup

  1. Download and install Node.js and npm.
  2. Install gulp using npm install -g gulp.
  3. In the theme folder, ensure the theme-build repository has been added as a submodule in a folder called 'build' and is up to date. This can be done using git submodule add [email protected]:siteorigin/theme-build.git build
  4. In a terminal, navigate to the build directory in the theme and run npm install
  5. Get some coffee while npm installs the required packages.

Running builds

There are two build tasks, build:release and build:dev.

The release task performs the following subtasks:

  1. Extracts the name of the theme from the parent directory into a variable called themeSlug.
  2. Updates the version number in the functions.php and readme.txt files.
  3. Compiles SASS files to CSS.
  4. Minifies JavaScript files and adds a .min suffix.
  5. Copies all files to a dist/{themeSlug} folder.
  6. Creates a .zip archive with the appropriate filename ready for uploading to wordpress.org.

Release task usage:

gulp build:release -v version

Where version should be replaced with the required version number. For example, say the next version of the theme is 1.2.3:

gulp build:release -v 1.2.3

The dev build task only has one subtask:

  1. Watch SASS files for changes and compile to CSS.

This is simply to avoid having to manually recompile SASS files while working on them.

theme-build's People

Contributors

braamgenis avatar gregpriday avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.