This module exposes a really simple API for configuring and controlling the Wintersmith static site generator. This is useful if you use a task runner (like gulp or Grunt) with your static site workflow. This module will allow you to automatically compile assets and refresh the browser when you edit Markdown files or change something in the templates etc.
Install via npm:
npm install run-wintersmith --save
Require it in your project:
var runWintersmith = require('run-wintersmith');
Call one of the API methods:
runWintersmith.preview(); // or runWintersmith.build();
Usage with gulp
Please take a look at the
example-gulpfile.js to see full usage example.
Feel free to get in touch if you need help setting it up.
Starts the Wintersmith site in preview mode, with default hostname and port. (
Generates the Wintersmith site to the default directory. (
The module has a few default settings. They can be overwritten in the following way:
var runWintersmith = require('run-wintersmith'); runWintersmith.settings.hostname = 'somehostname'; runWintersmith.settings.port = 8080; runWintersmith.settings.configFile = 'myConfig.json';
Sets which Wintersmith configuration file to read from. Default is
Sets the server hostname. Default is
localhost. Only used in
Sets the server port. Default is
3000. Only used in
At first, I created
gulp-wintersmith as gulp plugin to automate my development workflow with Wintersmith. But as I learned from the gulp core team: Creating a specific plugin to connect them, is in violation of the gulp plugin guidelines and of the spirit of creating non-specific modules.
So instead I made this module more generic, so it could be used in different contexts and not only with gulp.
Feedback and contribution
I'm still new to creating and publishing modules, please let me know if you have any ideas or feedback to this module.
MIT © Vanja Cosic