diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000..c7fe0666 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,20 @@ +{ + "bitwise": true, + "browser": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "es5": false, + "esnext": true, + "immed": true, + "jquery": true, + "latedef": true, + "newcap": true, + "noarg": true, + "node": true, + "strict": false, + "trailing": false, + "undef": true, + "multistr": true, + "expr": true +} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..52c10e31 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,107 @@ +'use strict'; +module.exports = function(grunt) { + + grunt.initConfig({ + jshint: { + options: { + jshintrc: '.jshintrc' + }, + all: [ + 'Gruntfile.js', + 'assets/js/*.js', + 'assets/js/plugins/*.js', + '!assets/js/scripts.min.js' + ] + }, + recess: { + dist: { + options: { + compile: true, + compress: true + }, + files: { + 'assets/css/main.min.css': [ + 'assets/less/main.less' + ] + } + } + }, + uglify: { + dist: { + files: { + 'assets/js/scripts.min.js': [ + 'assets/js/plugins/*.js', + 'assets/js/_*.js' + ] + } + } + }, + imagemin: { + dist: { + options: { + optimizationLevel: 7, + progressive: true + }, + files: [{ + expand: true, + cwd: 'images/', + src: '{,*/}*.{png,jpg,jpeg}', + dest: 'images/' + }] + } + }, + svgmin: { + dist: { + files: [{ + expand: true, + cwd: 'images/', + src: '{,*/}*.svg', + dest: 'images/' + }] + } + }, + watch: { + less: { + files: [ + 'assets/less/*.less', + 'assets/less/bootstrap/*.less' + ], + tasks: ['recess'] + }, + js: { + files: [ + '<%= jshint.all %>' + ], + tasks: ['jshint','uglify'] + } + }, + clean: { + dist: [ + 'assets/css/main.min.css', + 'assets/js/scripts.min.js' + ] + } + }); + + // Load tasks + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-recess'); + grunt.loadNpmTasks('grunt-contrib-imagemin'); + grunt.loadNpmTasks('grunt-svgmin'); + + // Register tasks + grunt.registerTask('default', [ + 'clean', + 'recess', + 'uglify', + 'imagemin', + 'svgmin' + ]); + grunt.registerTask('dev', [ + 'watch' + ]); + +}; \ No newline at end of file diff --git a/_config.yml b/_config.yml index b1f157c5..bfb56328 100644 --- a/_config.yml +++ b/_config.yml @@ -64,4 +64,4 @@ kramdown: coderay_css: class include: [".htaccess"] -exclude: ["lib", "config.rb", "Capfile", "config", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "minimal-mistakes.sublime-project", "minimal-mistakes.sublime-workspace"] \ No newline at end of file +exclude: ["lib", "config.rb", "Capfile", "config", "log", "Rakefile", "Rakefile.rb", "tmp", "less", "*.sublime-project", "*.sublime-workspace", "test", "spec", "Gruntfile.js", "package.json", "node_modules"] \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 6d720d13..49630ad1 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -38,7 +38,7 @@ - +