Skip to content

Instantly share code, notes, and snippets.

@zergiocosta
Last active December 20, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zergiocosta/6144220 to your computer and use it in GitHub Desktop.
Save zergiocosta/6144220 to your computer and use it in GitHub Desktop.
What I'm working with
http_path = "../"
css_dir = "../assets/css"
sass_dir = "../assets/sass"
images_dir = "../assets/images"
javascripts_dir = "../assets/js"
fonts_dir = "../assets/fonts"
# For development
environment = :development
output_style = :compact
relative_assets = true
line_comments = true
color_output = false
# For production
environment = :production
output_style = :compressed
relative_assets = true
line_comments = false
color_output = false
|
├── api/
├── assets/
│ │ css/
│ │ ├── plugins.css
│ │ ├── print.css
│ │ └── style.css
│ │ fonts/
│ │ images/
│ │ ├── bgs/
│ │ ├── icons/
│ │ ├── libs/
│ │ ├── menu/
│ │ └── uploads/
│ │ js/
│ │ └── vendor/
│ │ sass/
│ │ ├── variables.scss
│ │ ├── plugins.scss
│ │ ├── print.scss
│ │ └── style.scss
├── ie/
├── includes/
├── src/
│ ├── config.rb
│ ├── Gruntfile.js
│ └── README.md
├── 404.php
├── htaccess.txt
├── humans.txt
├── index.php
├── office.php
├── projects.php
├── README.md
├── robots.txt
├── single.php
└── team.php
|
├── api/
├── assets/
│ │ css/
│ │ ├── plugins.css
│ │ ├── print.css
│ │ └── style.css
│ │ fonts/
│ │ images/
│ │ ├── bgs/
│ │ ├── icons/
│ │ ├── libs/
│ │ ├── menu/
│ │ └── uploads/
│ │ js/
│ │ └── vendor/
│ │ sass/
│ │ ├── variables.scss
│ │ ├── plugins.scss
│ │ ├── print.scss
│ │ └── style.scss
├── ie/
├── includes/
├── src/
│ ├── config.rb
│ ├── Gruntfile.js
│ └── README.md
├── 404.php
├── footer.php
├── functions.php
├── header.php
├── htaccess.txt
├── humans.txt
├── index.php
├── page.php
├── README.md
├── robots.txt
├── single.php
└── style.css
"use strict";
module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
var ambitiousConfig = {
// Setting Directories
dirs: {
app: "../",
js: "../assets/js",
sass: "../assets/sass",
css: "../assets/css",
img: "../assets/images"
},
// Metadata
pkg: grunt.file.readJSON("package.json"),
banner:
"\n" +
"/*\n" +
"* -------------------------------------------------------\n" +
"* Project: <%= pkg.title %>\n" +
"* Version: <%= pkg.version %>\n" +
"*\n" +
"* Author: <%= pkg.author.name %>\n" +
"* URL: <%= pkg.author.url %>\n" +
"* Contact: <%= pkg.author.email %>\n" +
"*\n" +
"*\n" +
"* Copyright (c) <%= grunt.template.today*(\"yyyy\")%> <%= pkg.author.name %>\n" +
"* -------------------------------------------------------\n" +
"*/\n" +
"",
// Watch
watch: {
options: {
livereload: true,
},
compass: {
files: [
"<%= dirs.css %>/{,*/}*.css",
"<%= dirs.sass %>/{,*/}*.{scss,sass}"
],
tasks: ["compass"],
},
js: {
files: [
"<%= jshint.all %>",
],
tasks: ["jshint", "uglify"],
},
html: {
files: [
// supported files: html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp
"<%= dirs.app %>/*.{html,htm,shtml,shtm,xhtml,php,jsp,asp,aspx,erb,ctp}",
]
}
},
// JShint
jshint: {
options: {
jshintrc: ".jshintrc",
},
all: [
"Gruntfile.js",
"<%= dirs.js %>/*.js",
]
},
// Uglify
uglify: {
options: {
mangle: false,
banner: "<%= banner %>"
},
dist: {
files: {
// Main JS
"<%= dirs.js %>/main.min.js": [
"<%= dirs.js %>/main.js",
],
// External Plugins
"<%= dirs.js %>/plugins.min.js": [
"<%= dirs.js %>/plugins.js",
]
}
}
},
// Compass
compass: {
dist: {
options: {
environment: "production",
output_style: "compressed
force: true,
config: "config.rb",
}
}
},
// Image Optimization
imagemin: {
dist: {
options: {
optimizationLevel: 3,
progressive: true,
},
files: [{
expand: true,
cwd: "<%= dirs.img %>/",
src: "<%= dirs.img %>/**",
dest: "<%= dirs.img %>/",
}]
}
},
// Deploy
'ftp-deploy': {
build: {
auth: {
host: 'server.com',
port: 21,
authKey: 'key1'
},
src: 'path/to/source/folder',
dest: '/path/to/destination/folder',
exclusions: ['path/to/source/folder/**/.DS_Store', 'path/to/source/folder/**/Thumbs.db', 'dist/tmp']
}
},
};
// Init Grunt
// Notify
grunt.initConfig({
notify: {
task_name: {
options: {
// Task-specific options go here.
}
},
watch: {
options: {
title: 'Task Complete', // optional
message: 'SASS and Uglify finished running', //required
}
},
server: {
options: {
message: 'Server is ready!'
}
}
}
});
// Register Tasks
// ----------------
// Watch Project
grunt.registerTask( "default", [ "watch" ]);
// Optimize the images files
grunt.registerTask( "o", [ "imagemin" ]);
// Deploy
grunt.registerTask( "deploy", [ "ftp-deploy" ]);
};
"use strict";
module.exports = function(grunt) {
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
var ambitiousConfig = {
// Wordpress Theme Name
theme_name : 'theme-name',
// Setting Directories
dirs: {
app: "../",
js: "../assets/js",
sass: "../assets/sass",
css: "../assets/css",
img: "../assets/images"
},
// Metadata
pkg: grunt.file.readJSON("package.json"),
banner:
"\n" +
"/*\n" +
"* -------------------------------------------------------\n" +
"* Project: <%= pkg.title %>\n" +
"* Version: <%= pkg.version %>\n" +
"*\n" +
"* Author: <%= pkg.author.name %>\n" +
"* URL: <%= pkg.author.url %>\n" +
"* Contact: <%= pkg.author.email %>\n" +
"*\n" +
"*\n" +
"* Copyright (c) <%= grunt.template.today*(\"yyyy\")%> <%= pkg.author.name %>\n" +
"* -------------------------------------------------------\n" +
"*/\n" +
"",
// Watch
watch: {
options: {
livereload: true,
},
compass: {
files: [
"<%= dirs.css %>/{,*/}*.css",
"<%= dirs.sass %>/{,*/}*.{scss,sass}"
],
tasks: ["compass"],
},
js: {
files: [
"<%= jshint.all %>",
],
tasks: ["jshint", "uglify"],
},
html: {
files: [
// supported files: html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp
"<%= dirs.app %>/*.{html,htm,shtml,shtm,xhtml,php,jsp,asp,aspx,erb,ctp}",
]
}
},
// JShint
jshint: {
options: {
jshintrc: ".jshintrc",
},
all: [
"Gruntfile.js",
"<%= dirs.js %>/*.js",
]
},
// Uglify
uglify: {
options: {
mangle: false,
banner: "<%= banner %>"
},
dist: {
files: {
// Main JS
"<%= dirs.js %>/main.min.js": [
"<%= dirs.js %>/main.js",
],
// External Plugins
"<%= dirs.js %>/plugins.min.js": [
"<%= dirs.js %>/plugins.js",
]
}
}
},
// Compass
compass: {
dist: {
options: {
environment: "production",
output_style: "compressed",
force: true,
config: "config.rb",
}
}
},
// Image Optimization
imagemin: {
dist: {
options: {
optimizationLevel: 3,
progressive: true,
},
files: [{
expand: true,
cwd: "<%= dirs.img %>/",
src: "<%= dirs.img %>/**",
dest: "<%= dirs.img %>/",
}]
}
},
// Deploy
'ftp-deploy': {
build: {
auth: {
host: 'server.com',
port: 21,
authKey: 'key1'
},
src: 'path/to/source/folder',
dest: '/path/to/destination/folder',
exclusions: ['path/to/source/folder/**/.DS_Store', 'path/to/source/folder/**/Thumbs.db', 'dist/tmp']
}
},
};
// Init Grunt
// Notify
grunt.initConfig({
notify: {
task_name: {
options: {
// Task-specific options go here.
}
},
watch: {
options: {
title: 'Task Complete', // optional
message: 'SASS and Uglify finished running', //required
}
},
server: {
options: {
message: 'Server is ready!'
}
}
}
});
// Register Tasks
// ----------------
// Watch Project
grunt.registerTask( "default", [ "watch" ]);
// Optimize the images files
grunt.registerTask( "o", [ "imagemin" ]);
// Deploy
grunt.registerTask( "deploy", [ "ftp-deploy" ]);
};
* jQuery
* Modernizr
* Bootstrap or Foundation
* BxSlider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment