Browse Source

Add Grunt build script

master
Michael Rose 9 years ago
parent
commit
eadc79e066
  1. 20
      .jshintrc
  2. 107
      Gruntfile.js
  3. 2
      _includes/head.html
  4. 2
      _includes/scripts.html
  5. 3664
      assets/css/main.css
  6. 25
      assets/css/main.min.css
  7. 26
      assets/js/_main.js
  8. 1114
      assets/js/main.js
  9. 0
      assets/js/plugins/jquery.dlmenu.js
  10. 0
      assets/js/plugins/jquery.fitvids.js
  11. 0
      assets/js/plugins/respond.js
  12. 1
      assets/js/scripts.min.js
  13. 25
      package.json

20
.jshintrc

@ -0,0 +1,20 @@ @@ -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
}

107
Gruntfile.js

@ -0,0 +1,107 @@ @@ -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'
]);
};

2
_includes/head.html

@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- For all browsers -->
<link rel="stylesheet" href="{{ site.url }}/assets/css/main.css">
<link rel="stylesheet" href="{{ site.url }}/assets/css/main.min.css">
<!-- Webfonts -->
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">

2
_includes/scripts.html

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ site.url }}/assets/js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
<script src="{{ site.url }}/assets/js/main.js"></script>
<script src="{{ site.url }}/assets/js/scripts.min.js"></script>
{% if site.google_analytics %}
<!-- Asynchronous Google Analytics snippet -->
<script>

3664
assets/css/main.css

File diff suppressed because it is too large Load Diff

25
assets/css/main.min.css vendored

File diff suppressed because one or more lines are too long

26
assets/js/_main.js

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
/*! Plugin options and other jQuery stuff */
// dl-menu options
$(function() {
$( '#dl-menu' ).dlmenu({
animationClasses : { classin : 'dl-animate-in', classout : 'dl-animate-out' }
});
});
// FitVids options
$(function() {
$("article").fitVids();
});
$(".close-menu").click(function () {
$(".menu").toggleClass("disabled");
$(".links").toggleClass("enabled");
});
$(".about").click(function () {
$("#about").css('display','block');
});
$(".close-about").click(function () {
$("#about").css('display','');
});

1114
assets/js/main.js

File diff suppressed because it is too large Load Diff

0
assets/js/vendor/jquery.dlmenu.js → assets/js/plugins/jquery.dlmenu.js

0
assets/js/vendor/jquery.fitvids.js → assets/js/plugins/jquery.fitvids.js

0
assets/js/vendor/respond.js → assets/js/plugins/respond.js

1
assets/js/scripts.min.js vendored

File diff suppressed because one or more lines are too long

25
package.json

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
{
"name": "hpstr-theme",
"author": "Michael Rose <michael@mademistakes.com>",
"homepage": "http://mmistakes.github.io/hpstr-jekyll-theme/",
"repository": {
"type": "git",
"url": "git://github.com/mmistakes/hpstr-jekyll-theme.git"
},
"bugs": {
"url": "https://github.com/mmistakes/hpstr-jekyll-theme/issues"
},
"engines": {
"node": ">= 0.10.0"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.2",
"grunt-recess": "~0.3.5",
"grunt-contrib-imagemin": "~0.2.0",
"grunt-svgmin": "~0.2.0"
}
}
Loading…
Cancel
Save