If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-sorry-theme-deploy --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

The ID of the page to which you wish to deploy your theme. You can find this in the address bar of your Sorry account when viewing your page. i.e. a URL of http://app.sorryapp.com/pages/my-page means your page ID is my-page.

We need somewhere to keep your Sorry login credentials. In the root of your project create a file called sorry.json which contains your username and password. You should never check your Sorry credentials in to version control! Load them from an external file like this, which is outside of the repo or excluded by .gitignore.

{

"username":"your email address goes here",

"password":"your password goes here"

}

Now you can configure your grunt task, loading your Sorry login details from the external file you created above.

grunt.initConfig({

// Load in your sorry credentials.

// NOTE: NEVER CHECK YOUR CREDENTIALS INTO YOUR REPOSITORY.

sorry: grunt.file.readJSON('sorry.json'),

// Configuration to be run.

sorry_theme_deploy:{

options:{

username:'<%= sorry.username %>',

password:'<%= sorry.password %>'

},

theme:{

expand:true,

cwd:'src/',

src:['**/*']

},

}

});

You can also see from this config that we define the themes files as being in a directory named src. These files could be anywhere you like, but we always recommend this as a sensible default.

Now your options are configured you can deploy your theme to your chosen page. Whist you can define your target page in the configuration, to give you flexibility we suggest using the command line argument --sorry-page