Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bhaskarmelkani/sails-generate-views-hbs

Generate default views for a Sails app using handlebar templates,
https://github.com/bhaskarmelkani/sails-generate-views-hbs

generator handlebars hbs js sails sails-generator sailsjs templates views

Last synced: about 1 month ago
JSON representation

Generate default views for a Sails app using handlebar templates,

Awesome Lists containing this project

README

        

# sails-generate-views-hbs

A `views-hbs` generator for use with the Sails command-line interface.

Certain generators are installed by default in Sails, but they can be overridden. Other generators create entirely new things. Check the [Sails docs](http://sailsjs.org/#!documentation) for information on installing generator overrides / custom generators and information on building your own generators.

[![Dependency Status](https://david-dm.org/bhaskarmelkani/sails-generate-views-hbs/status.svg?style=flat)](https://david-dm.org/bhaskarmelkani/sails-generate-views-hbs)    [![npm version](https://img.shields.io/npm/v/sails-generate-views-hbs.svg)](https://badge.fury.io/js/sails-generate-views-hbs)    [![GitHub issues](https://img.shields.io/github/issues/bhaskarmelkani/sails-generate-views-hbs.svg)](https://github.com/bhaskarmelkani/sails-generate-views-hbs/issues)

### 1. Installation

```sh
$ npm install sails-generate-views-hbs
```

### 2. Usage

##### On the command line

```sh
$ sails generate views-hbs
```

### 3. Configuration in sails.
#####File to update:- config/views.js
Update the file as follows.

```js
module.exports.views = {

engine: {
ext: 'handlebars',
fn: require("consolidate").handlebars
},

layout: 'layouts/layout',

partials: 'partials/'

};
```

That is it. Now sails should compile the handlebars files and serve it to you.

### Development

To get started quickly and see this generator in action, ...

Also see `CONTRIBUTING.md` for more information on overriding/enhancing existing generators.

### Questions?

See `FAQ.md`.

### More Resources

- [Stackoverflow](http://stackoverflow.com/questions/tagged/sails.js)
- [#sailsjs on Freenode](http://webchat.freenode.net/) (IRC channel)
- [Twitter](https://twitter.com/sailsjs)
- [Professional/enterprise](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#are-there-professional-support-options)
- [Tutorials](https://github.com/balderdashy/sails-docs/blob/master/FAQ.md#where-do-i-get-help)
- Sails.js logo (small)

### License

**[MIT](./LICENSE)**
© 2017 [balderdashy](http://github.com/balderdashy) & contributors

As for [Sails](http://sailsjs.org)? It's free and open-source under the [MIT License](http://sails.mit-license.org/).

![[email protected]](http://i.imgur.com/RIvu9.png)