Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.

Commit

Permalink
Describe usage of the task - #3
Browse files Browse the repository at this point in the history
  • Loading branch information
francescomari committed Aug 15, 2013
1 parent ff5926b commit 837430e
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,61 @@ The content can be uploaded multiple times. If the resource doesn't exist, the S

The task can only push new changes to nodes and properties to the Sling instance, but it will never remove anything. If you want to remove a node or a property which has been pushed by a previous invocation of the task, you have to do it manually. In this case, the Content Explorer embedded in Sling can be helpful.

## Installation

To use this task, you have to install Grunt first. Please follow the [installation instructions](http://gruntjs.com/getting-started) for Grunt in the official documentation.

To install the task, simply invoke NPM from the root of your project.

```
npm install grunt-sling-content
```

Optionally, you can save the dependency in your `package.json` by adding a command line option as shown below.

```
npm install --save-dev grunt-sling-content
```

## Usage

Let's assume you have a project with the following directory structure:

```
project/
root/
apps/
blog/
page/
GET.esp
post/
GET.esp
content/
blog/
first-post.json
blog.json
package.json
Gruntfile.js
```

To publish to a running Sling instance the content of the `root` folder, you have to update the contents of `Gruntfile.js` to reference and configure the task.

```
module.exports = function (grunt) {
grunt.initConfig({
"sling-content": {
root: "root"
}
});
grunt.loadNpmTasks("grunt-sling-content");
grunt.registerTask("default", ["sling-content"]);
};
```

Invoking the task to push the content in the `root` folder is as simple as invoking `grunt` from the root of your project.

## Options

The task accept the following options:
Expand Down

0 comments on commit 837430e

Please sign in to comment.