Giter Club home page Giter Club logo

handlebars-helper-css's Introduction

{{css}} NPM version

Handlebars helper for adding stylesheets based on config settings.

This helper can optionally manage:

  • minification
  • concatenation
  • revisioning / cache-busting
  • copying files to dest directory (e.g. assets/css/)
  • deleting files prior to each build

Example

{{#css}}
  <link rel="stylesheet" href="{{@path}}">
{{/css}}

Results in something like:

<link rel="stylesheet" href="../../../assets/css/18f5e.styles.min.css">

Or without concatenation:

<link rel="stylesheet" href="../../../assets/css/3df5e.ad.min.css">
<link rel="stylesheet" href="../../../assets/css/42772.banner.min.css">
<link rel="stylesheet" href="../../../assets/css/39528.body.min.css">
<link rel="stylesheet" href="../../../assets/css/73095.button.min.css">
<link rel="stylesheet" href="../../../assets/css/1dd65.callouts.min.css">
<link rel="stylesheet" href="../../../assets/css/efcde.examples.min.css">
<link rel="stylesheet" href="../../../assets/css/9eaf6.footer.min.css">

Installation

Install with npm

npm i handlebars-helper-css --save-dev

Install with bower

bower install handlebars-helper-css --save-dev

Register the helper

The easiest way to register the helper with Assemble is to add the module to devDependencies and keywords in your project's package.json:

{
  "devDependencies": {
    "handlebars-helper-css": "*"
  },
  "keywords": [
    "handlebars-helper-css"
  ]
}

Alternatively, to register the helper explicitly in the Gruntfile:

grunt.initConfig({
  assemble: {
    options: {
      // the 'handlebars-helper-css' npm module must also be listed in
      // devDependencies for assemble to automatically resolve the helper
      helpers: ['handlebars-helper-css', 'foo/*.js']
    },
    files: {
      'dist/': ['src/templates/*.hbs']
    }
  }
});

Author

Jon Schlinkert

License and Copyright

Copyright (c) 2014 Jon Schlinkert, contributors. Licensed under the MIT License

handlebars-helper-css's People

Contributors

jonschlinkert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

joaopauloit

handlebars-helper-css's Issues

Update Dependencies - Security Vulnerabilities

Package: minimatch
Vulnerability: Regular Expression Denial of Service
Patched in: >=3.0.2
Path: handlebars-helper-css > fs-utils > globule > glob > minimatch
More info: https://npmjs.com/advisories/118

Package: underscore.string
Vulnerability: Regular Expression Denial of Service
Patched in: >=3.3.5
Path: handlebars-helper-css > fs-utils > js-yaml > argparse > underscore.string
More info: https://npmjs.com/advisories/745

Package: clean-css
Vulnerability: Regular Expression Denial of Service
Patched in: >=4.1.11
Path: handlebars-helper-css > clean-css
More info: https://npmjs.com/advisories/785

Package: js-yaml
Vulnerability: Code Injection
Patched in: >=3.13.0
Path: handlebars-helper-css > fs-utils > js-yaml
More info: https://npmjs.com/advisories/788

Package: lodash
Vulnerability: Prototype Pollution
Patched in: >=4.17.11
Path: handlebars-helper-css > fs-utils > globule > lodash
More info: https://npmjs.com/advisories/782

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.