Skip to content

Commit

Permalink
Update Gruntfile and rerun grunt tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspar Naaber committed Oct 7, 2014
1 parent a09d190 commit 8bca393
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 78 deletions.
112 changes: 67 additions & 45 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-modernizr');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-contrib-watch');
"use strict";

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
Expand Down Expand Up @@ -55,7 +46,24 @@ module.exports = function(grunt) {
}
},

// Concatenates javascripts into one file.
// Copys the standalone (not concatenated) javascript source files to the javascripts folder.
copy: {
javascripts: {
files: [
{
expand: true,
cwd: 'javascripts/src',
src: [
'*.js',
'!modernizr.js'
],
dest: 'javascripts/'
}
]
}
},

// Concatenates the javascript source files to the javascripts folder.
concat: {
build: {
src: [
Expand Down Expand Up @@ -84,11 +92,11 @@ module.exports = function(grunt) {

// Compiles the stylesheet files.
sass: {
options: {
style: 'expanded',
sourcemap: 'none'
},
build: {
options: {
style: 'expanded',
sourcemap: 'none'
},
files: [{
expand: true,
cwd: 'stylesheets/scss',
Expand All @@ -99,6 +107,19 @@ module.exports = function(grunt) {
}
},

exec: {
kitmanifest: {
cmd: function(file) {
return 'kit manifest';
}
},
kit: {
cmd: function(file) {
return 'kit push -s ' + grunt.option('site') + ' ' + file;
}
}
},

// Minifies the stylesheet files.
cssmin: {
build: {
Expand All @@ -115,7 +136,7 @@ module.exports = function(grunt) {

// Minifies the image files.
imagemin: {
images: {
build: {
files: [{
expand: true,
cwd: 'images/src/',
Expand All @@ -140,47 +161,48 @@ module.exports = function(grunt) {

// Watches the project for changes and recompiles the output files.
watch: {
concat: {
js: {
files: 'javascripts/src/concat/*.js',
tasks: 'concat'
},

uglify: {
files: [
'javascripts/*.js',
'!javascripts/*.min.js'
],
tasks: 'newer:uglify',
options: {
spawn: false
}
tasks: ['newer:concat', 'newer:uglify']
},

css: {
files: 'stylesheets/scss/*.scss',
tasks: ['sass', 'cssmin'],
options: {
spawn: false
}
tasks: ['sass:build', 'newer:cssmin:build']
},

imagemin: {
files: 'images/src/*.{png,jpg,gif}',
tasks: 'newer:imagemin',
options: {
spawn: false
}
},

svgmin: {
files: 'assets/src/*.svg',
tasks: 'newer:svgmin',
voog: {
files: ['javascripts/*.js', 'stylesheets/*.css', 'layouts/*.tpl', 'components/*.tpl'],
options: {
spawn: false
}
}
},
});

grunt.registerTask('default', ['bowercopy', 'modernizr', 'concat', 'uglify', 'sass', 'cssmin', 'imagemin', 'svgmin']);
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-modernizr');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-svgmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-exec');

grunt.registerTask('default', ['bowercopy', 'modernizr', 'copy', 'concat', 'uglify', 'sass', 'cssmin', 'imagemin', 'svgmin']);

grunt.event.on('watch', function(action, filepath, target) {
if (target == 'voog') {
if (action == "added" || action == "deleted") {
grunt.task.run(['exec:kitmanifest']);
}
if (action != "deleted") {
grunt.task.run(['exec:kit:' + filepath]);
}
}
});
};
2 changes: 1 addition & 1 deletion assets/close-round-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/close-round.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/ico-search-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/ico-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/ico-tag-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/ico-tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -11526,7 +11526,7 @@ MMCQ = (function() {
};

// SCROLLS TO THE COMMENT-FORM IF COMMENT SUBMIT FAILED (TO SHOW THE ERROR MESSAGES TO THE USER)
var focusCommentsWithErrors = function() {
var focusFormWithErrors = function() {
$(document).ready(function() {
if ($('.comment-form').hasClass('form_with_errors')) {
$('html, body').scrollTop($('.comment-form').offset().top);
Expand Down Expand Up @@ -11649,12 +11649,12 @@ MMCQ = (function() {

var initArticlePage = function() {
// ADD SINGLE POST VIEW SPECIFIC FUNCTIONS HERE
focusCommentsWithErrors();
focusFormWithErrors();
};

var initCommonPage = function() {
// ADD COMMON PAGE SPECIFIC FUNCTIONS HERE
focusCommentsWithErrors();
focusFormWithErrors();
};

var initFrontPage = function() {
Expand All @@ -11665,7 +11665,7 @@ MMCQ = (function() {
}
});
$(window).on('resize', resizeContentRight);
focusCommentsWithErrors();
focusFormWithErrors();
};

var resizeTimeout;
Expand Down
36 changes: 18 additions & 18 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@
"title": "menu-mobile"
},
{
"content_type": "component",
"component": true,
"file": "components/news.tpl",
"layout_name": "news",
"title": "news"
"content_type": "blog",
"component": false,
"file": "layouts/blog___news.tpl",
"layout_name": "blog",
"title": "Blog & News"
},
{
"content_type": "component",
Expand Down Expand Up @@ -203,6 +203,18 @@
}
],
"assets": [
{
"content_type": "image/svg+xml",
"file": "assets/arr-bottom.svg",
"kind": "assets",
"filename": "arr-bottom.svg"
},
{
"content_type": "image/svg+xml",
"file": "assets/arr-top.svg",
"kind": "assets",
"filename": "arr-top.svg"
},
{
"content_type": "image/svg+xml",
"file": "assets/close-round-dark.svg",
Expand Down Expand Up @@ -322,18 +334,6 @@
"file": "stylesheets/main.min.css",
"kind": "stylesheets",
"filename": "main.min.css"
},
{
"content_type": "image/svg+xml",
"kind": "assets",
"file": "assets/arr-bottom.svg",
"filename": "arr-bottom.svg"
},
{
"content_type": "image/svg+xml",
"kind": "assets",
"file": "assets/arr-top.svg",
"filename": "arr-top.svg"
}
]
}
}
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"name": "voog-design-reykjavik",
"description": "The Reykjavik design template for Voog",
"repository": {
"type": "git",
"url": "git://github.com/Edicy/design-reykjavik.git"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bowercopy": "^1.1.0",
"grunt-modernizr": "^0.5.2",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-copy": "^0.6.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-imagemin": "^0.7.1",
"grunt-svgmin": "^0.4.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-exec": "^0.4.6",
"grunt-modernizr": "^0.5.2",
"grunt-newer": "^0.7.0",
"grunt-contrib-watch": "^0.6.1"
"grunt-svgmin": "^0.4.0"
}
}

0 comments on commit 8bca393

Please sign in to comment.