Code Monkey home page Code Monkey logo

docpad-plugin-grunt's Introduction

Grunt Plugin for DocPad

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status

Run Grunt tasks when building with DocPad.

Install

$ docpad install grunt

Configure

By default, the plugin will run the default tasks associated with Grunt during the writeAfter event with DocPad. This is equivilant to adding the following configuration to your DocPad configuration file:

  plugins:
    grunt:
      writeAfter: []

The following will run the "cssmin" and "uglify" tasks from Grunt during the generateAfter event:

  plugins:
    grunt:
      writeAfter: false
      generateAfter: ["cssmin", "uglify"]

The following can be used if you want the default tasks to run but just show a warning if the Gruntfile fails and continue running.

  plugins:
    grunt:
      warnOnError: true

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Unless stated otherwise all works are:

and licensed under:

docpad-plugin-grunt's People

Contributors

dcohenb avatar evantill avatar jtwebman avatar paulradzkov avatar robloach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docpad-plugin-grunt's Issues

render event

I wonder if its possible to adress the render or renderDocument event and hand over the content or filepath? I aim to run grunt tasks on each single rendered document.

Compiled JavaScript will only run notify event

When this latest version is built the only event that runs is the notify event as it is the last in the array of events.

I'm not a js expert so I have no real idea why it works for the last event but none of the previous ones.

List of files to add to the Files Collection after Grunt doings

@bobobo1618 mentioned that DocPad Sunny only uploads files that DocPad handles in bobobo1618/docpad-plugin-sunny#17 . We should add files that Grunt generates to DocPad's Files Collection after Grunt runs.

# Test DocPad exports
module.exports = {
  templateData:
    site:
      title: "Grunt Plugin for DocPad"

  plugins:
    grunt:
      gruntTasks: ["cssmin", "uglify"]
      files: [
        "stuff.min.css",
        "stuff.min.js"
      ]
}

Since Grunt will run cssmin and uglify, we should then add .min.css and .min.js to the DocPad files collection.

Missing `node` in spawn command on windows

When I use this plugin I get this error:

error: Something went wrong with the action
error: An error occured:
Error: spawn ENOENT
    at errnoException (child_process.js:988:11)
    at Process.ChildProcess._handle.onexit (child_process.js:779:34)

So I looked into the code, and this line needs a 'node' command to work (as the shebang does nothing on windows):

command = [@path.join rootPath, gruntPath]

https://github.com/RobLoach/docpad-plugin-grunt/blob/master/src/grunt.plugin.coffee#L52

Then it works as expected.

(well, small detail: it needs an extra newline: the 'Running "xyz" task' message gets appended to the progress bar's line:

FooPerforming generate: generateBefore at 5/10 50% ========================-------------------------Running "echo" task
echo!

Done, without errors.

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.