Socket
Book a DemoInstallSign in
Socket

grunt-bliss

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-bliss

Compile Bliss templates.

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

grunt-bliss Build Status

Compile Bliss templates.

Getting Started

This plugin requires Grunt ~0.4.1

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-bliss --save-dev

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

  grunt.loadNpmTasks('grunt-bliss');

Bliss task

Run this task with the grunt bliss command.

Configuration

  bliss: {
    options: {
      context: {
        data: {
          day: 10,
          year: 1999
        }
      }
    },
    compile: {
      files: {
        'tmp/bliss.html': ['test/fixtures/bliss.js.html']
      },
      options: {
        context: {
          data: {
            year: '2013'
          }
        }
      }
    }
  }

Related template (bliss.js.html):

  @{
    products = [{
      name: "foo",
      price: 123
    },{
      name: "bar",
      price: 123
    }]
  }

  <ul>
    <div>
      @data.year-@data.day
    </div>
    @for(var p=0; p<products.length; p++) {
      @{ product = products[p] }
      <li>@product.name: ($@product.price)</li>
    }
  </ul>

Output:

  <ul>
    <div>2013-10</div>
    <li>foo: ($123)</li>
    <li>bar: ($123)</li>
  </ul>

Keywords

gruntplugin

FAQs

Package last updated on 31 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts