Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
snide committed Jun 20, 2014
0 parents commit 3344f7c
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 0 deletions.
83 changes: 83 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
'use strict';
module.exports = function(grunt) {

// ----------------------------------------------------------
// WARNING, BRAVE DEVELOPER
// ----------------------------------------------------------
// Webhook allows you to use local grunt tasks and files.
// However, these tasks are ONLY RUN LOCALLY and not when
// your live site needs to be rebuilt. This means you should
// only use grunt for pre-processing tasks like building
// Sass, less or coffescript files, not for reading things
// from your templates and making dynamic changes during
// the build process. Doing so will cause your live site
// not to regerate.
//
// You have been warned!

grunt.initConfig({
// BUILD SASS TO CSS
sass: {
dev: {
options: {
// We used the expanded style because Webhook already minifies CSS when it deploys your site.
style: 'expanded',

// Uncomment the below line to include outside directories as well.
// loadPath: ['location/of/other/sass']
},
files: [{
// Files in the /sass/ directory will go to /static/css/ when processed.
expand: true,
cwd: 'sass',
src: ['*.sass'],
dest: 'static/css',
ext: '.css'
}]
}
},

// BUILD LESS TO CSS
less: {
dev: {
options: {
// Uncomment the below line to include outside directories as well.
// paths: ['location/of/other/less/']
},
files: [{
// Files in the /less/ directory will go to /static/css/ when processed.
expand: true,
cwd: 'less',
src: ['*.less'],
dest: 'static/css',
ext: '.css'
}]
}
},

// BUILD COFFEE TO JAVASCRIPT
coffee: {
compile: {
files: {
'static/javascript/main.js': ['coffee/*.coffee'] // compile and concat into single file
}
},
},
watch: {
options : {
files: ['sass/**/*.sass', 'less/**/*.less','bower_components/wyrm/sass/**/*.sass'],
tasks: ['sass', 'less', 'coffee', 'build']
},
}
});

// THIS LOADS THE TASKS WE NEED ABOVE IN FROM OUR NPM
// Note, that we need to have these installed through the package.json file as well
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-coffee');

// NEVER REMOVE THESE LINES, OR ELSE YOUR PROJECT MAY NOT WORK
require('./options/generatorOptions.js')(grunt);
grunt.loadTasks('tasks');
};
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Webhook preprocessor theme

This theme builds a grunt file and installs the needed
Node modules to preprocess Sass, Less and Coffescript
files.

Once installed, you'll need your restart your Webhook
runserver for the watch command to properly fire.
28 changes: 28 additions & 0 deletions coffee/main.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Assignment:
number = 42
opposite = true

# Conditions:
number = -42 if opposite

# Functions:
square = (x) -> x * x

# Arrays:
list = [1, 2, 3, 4, 5]

# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x

# Splats:
race = (winner, runners...) ->
print winner, runners

# Existence:
alert "I knew it!" if elvis?

# Array comprehensions:
cubes = (math.cube num for num in list)
1 change: 1 addition & 0 deletions less/main.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Pace your less here
48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "webhook-generate",
"version": "0.0.1",
"description": "Grunt site generator for webhook",
"repository": {
"type": "git",
"url": "git://github.com/webhook/webhook-generate.git"
},
"author": "Webhook",
"license": "ISC",
"bugs": {
"url": "https://github.com/webhook/webhook-generate/issues"
},
"homepage": "https://github.com/webhook/webhook-generate",
"dependencies": {
"grunt": "~0.4.2",
"firebase": "1.0.2",
"mkdirp": "~0.3.5",
"grunt-contrib-connect": "~0.6.0",
"grunt-open": "~0.2.2",
"grunt-concurrent": "~0.4.2",
"request": "~2.31.0",
"grunt-simple-watch": "~0.1.2",
"lodash": "~2.4.1",
"glob": "~3.2.8",
"tiny-lr": "0.0.5",
"wrench": "~1.5.4",
"swig": "~1.3.0",
"ws": "~0.4.31",
"adm-zip": "~0.4.3",
"async": "~0.2.10",
"marked": "~0.3.1",
"grunt-usemin": "~2.0.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-cssmin": "~0.9.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-rev": "~0.1.0",
"win-spawn": "~2.0.0",
"proxy-middleware": "~0.5.0",
"connect-header": "0.0.5",
"uslug": "~1.0.3",
"grunt-connect-proxy": "~0.1.10",
"colors": "~0.6.2",
"grunt-contrib-sass": "~0.7.3",
"grunt-contrib-less": "~0.11.2",
"grunt-contrib-coffee": "~0.4.0"
}
}
1 change: 1 addition & 0 deletions sass/main.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// Place your sass here

0 comments on commit 3344f7c

Please sign in to comment.