Skip to content

Instantly share code, notes, and snippets.

@clupprich
Created January 2, 2014 17:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clupprich/8222739 to your computer and use it in GitHub Desktop.
Save clupprich/8222739 to your computer and use it in GitHub Desktop.
Gruntfile for developing Ghost themes. Heavily inspired by http://webdesign.tutsplus.com/tutorials/cms-tutorials/styling-our-ghost-theme-with-less/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
css: {
files: ['styles/*'],
tasks: ['sass', 'cssmin', 'copy:css']
},
js: {
files: ['js/*'],
tasks: ['uglify', 'copy:js']
}
},
uglify: {
options: {
mangle: false
},
combinejs: {
files: {
'dist/js/main.min.js': ['js/main.js']
}
}
},
sass: {
dist: {
files: {
'dist/css/main.css': ['styles/main.scss']
}
}
},
cssmin: {
combine: {
files: {
'dist/css/main.min.css': ['dist/css/main.css']
}
}
},
copy: {
js: {
src: 'dist/js/main.min.js',
dest: '<%= ghost_location %>content/themes/<%= ghost_theme_name %>/assets/js/main.min.js'
},
css: {
src: 'dist/css/main.min.css',
dest: '<%= ghost_location %>content/themes/<%= ghost_theme_name %>/assets/css/main.css'
}
},
'ghost_location': '../ghost/',
'ghost_theme_name': 'naiad',
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-copy');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment