Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-dust-html

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-dust-html

Grunt task to render Dust templates to HTML

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

About

This task renders Dust templates against a context to produce HTML.

Getting Started

Install this plugin with the command:

npm install grunt-dust-html

Next, add this line to your project's grunt file:

grunt.loadNpmTasks("grunt-dust-html");

Lastly, add the configuration settings (see below) to your grunt file.

Documentation

This task has two required properties, src and dest. src is the path to your source file and dest is the file this task will write to (relative to the grunt.js file). If this file already exists it will be overwritten.

An example configuration looks like this:

grunt.initConfig({
  dusthtml: {
    dist: {
      src: "src/home.dust",
      dest: "dist/home.html",

      options: {
        // see below for options. this is optional.
      }
    }
  }
});

Optional Configuration Properties

This plugin can be customized by specifying the following options:

  • whitespace: Whether or not to preserve whitespace. false by default.
  • context: A JavaScript object to render the template against. If this is a string, it is assumed the value is the location to a json file and it will be loaded in.
  • basePath: The base location to all your templates so that includes/partials can be resolved correctly.

FAQ

  1. Why does the output say undefined?
    Most likely dust is trying to include a file but it can't resove the path properly. Make sure you're setting a basePath option.

Keywords

FAQs

Package last updated on 19 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc