Skip to content

Instantly share code, notes, and snippets.

@jonknapp
Created October 13, 2016 11:51
Show Gist options
  • Save jonknapp/63e9a3e8633ef5d027fea2c184669268 to your computer and use it in GitHub Desktop.
Save jonknapp/63e9a3e8633ef5d027fea2c184669268 to your computer and use it in GitHub Desktop.

Slipcast: A static website generator

This project simplifies the creation of static websites by using convention over configuration to create an enjoyable front-end development experience.

Behind the scenes, it relies on Metalsmith, RollupJS, PostCSS, Handlebars, and Browsersync to build a directory of static css, html, and javascript files as well as a development mode that reloads your changes as files are saved. However, you don't have to worry about the details.

We've also made it easy for you to move on from slipcast if your complex application needs can no longer be handled by us. We've included an eject command that will remove slipcast and setup your project to run on the same scripts and configurations we've hidden behind the curtain for you to further customize or replace entirely.

Usage

Add this to your project with npm install slipcast --save. Then you can add the following to your package.json file to build, compress, or run a webserver that watches for changes.

...
    "scripts": {
        "build": "slipcast",
        "compress": "slipcast --compress",
        "eject": "slipcast --eject",
        "start": "slipcast --watch"
    }
...

You can view an example application structure by looking in the tests/fixtures directory of this project. It's the same project that will be installed if you use slipcast-cli to create your initial project.

Config File

The application looks for a file called slipcast.js in the root of the application folder for the configuration.

The configuration file looks like:

module.exports = {
  files: [
    'application.css',
    'application.js'
  ],
  folders: {
    css: 'app/css',
    javascript: 'app/js',
    pages: 'app/pages',
    static: 'app/static',
    views: 'app/views'
  },
  output: 'dist'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment