Skip to content

Commit

Permalink
Converted the project to Grunt (instead of Codekit)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortnod committed Mar 11, 2014
1 parent 1c87d26 commit e7af926
Show file tree
Hide file tree
Showing 25 changed files with 2,151 additions and 20 deletions.
5 changes: 4 additions & 1 deletion .gitignore
@@ -1,4 +1,7 @@
# Sass and Sompass
# Node
node_modules/

# Sass and Compass
.sass-cache/

# OS X
Expand Down
105 changes: 105 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,105 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

handlebars: {
options: {
namespace: 'Handlebars.templates',
processName: function(filePath) {
return filePath.replace(/^templates\//, '').replace(/\.handlebars$/, '');
}
},

all: {
files: {
"js/templates.js": ["templates/*.handlebars"]
}
}
},

concat: {
dist: {
src: [
'js/libs/*.js',
'js/templates.js',
'js/card.js',
'js/modal.js',
'js/content.js',
'js/schedule.js',
'js/analytics.js',
'js/header.js',
'js/global.js'
],
dest: 'js/build/production.js',
}
},

uglify: {
build: {
src: 'js/build/production.js',
dest: 'js/build/production.min.js'
}
},

compass: {
dist: {
options: {
config: 'config.rb'
}
}
},

watch: {
options: {
livereload: true,
},
scripts: {
files: ['js/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
},
},

css: {
files: ['css/*.scss'],
tasks: ['compass'],
options: {
spawn: false,
}
},

handlebars: {
files: ['templates/*.handlebars'],
tasks: ['handlebars', 'concat', 'uglify'],
options: {
spawn: false,
}
}
},

connect: {
server: {
options: {
port: 8000,
base: './'
}
}
}

});

// Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-handlebars');

// Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default', ['handlebars', 'concat', 'uglify', 'compass']);
grunt.registerTask('dev', ['connect', 'watch']);

};
4 changes: 2 additions & 2 deletions config.rb
Expand Up @@ -2,8 +2,8 @@

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
css_dir = "css/build"
sass_dir = "css"
images_dir = "img"
javascripts_dir = "js"
fonts_dir = "fonts"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions scss/_header.scss → css/_header.scss
Expand Up @@ -20,20 +20,20 @@ header {
margin-left: $margin;

.svg & {
background: url(../img/logo.svg) no-repeat top left;
background: url(../../img/logo.svg) no-repeat top left;
background-size: 88px 80px;
@include breakpoint (ant) { background-size: 44px 40px; }
}
.no-svg & {
background: url(../img/logo.png) no-repeat top left;
background: url(../../img/logo.png) no-repeat top left;
@include breakpoint (ant) { background-size: 44px 40px; }

}
}

#headertext {
float: left;

h1, h3 {
opacity: 0.7;
margin: 0 20px;
Expand Down
16 changes: 8 additions & 8 deletions scss/_modal.scss → css/_modal.scss
Expand Up @@ -186,21 +186,21 @@
}

// Other sites (modal section)
.bartebuss { background: url(../img/bartebuss-sprite-1x.png); }
.bartebuss:after { background: url(../img/bartebuss-sprite-1x.png) 0 50px; }
.bartebuss { background: url(../../img/bartebuss-sprite-1x.png); }
.bartebuss:after { background: url(../../img/bartebuss-sprite-1x.png) 0 50px; }

.notifier { background: url(../img/notifier-sprite-1x.png); }
.notifier:after { background: url(../img/notifier-sprite-1x.png) 0 50px; }
.notifier { background: url(../../img/notifier-sprite-1x.png); }
.notifier:after { background: url(../../img/notifier-sprite-1x.png) 0 50px; }

// On retina screens, use higher resolution
@media
(-webkit-min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi) {
.bartebuss { background: url(../img/bartebuss-sprite-2x.png); }
.bartebuss:after { background: url(../img/bartebuss-sprite-2x.png) 0 50px; }
.bartebuss { background: url(../../img/bartebuss-sprite-2x.png); }
.bartebuss:after { background: url(../../img/bartebuss-sprite-2x.png) 0 50px; }

.notifier { background: url(../img/notifier-sprite-2x.png); }
.notifier:after { background: url(../img/notifier-sprite-2x.png) 0 50px; }
.notifier { background: url(../../img/notifier-sprite-2x.png); }
.notifier:after { background: url(../../img/notifier-sprite-2x.png) 0 50px; }

.bartebuss, .bartebuss:after,
.notifier, .notifier:after {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scss/_pictograms.scss → css/_pictograms.scss
@@ -1,7 +1,7 @@
@font-face {
font-family: 'pictograms';
src: url('../fonts/pictograms.woff') format('woff'),
url('../fonts/pictograms.ttf') format('truetype');
src: url('../../fonts/pictograms.woff') format('woff'),
url('../../fonts/pictograms.ttf') format('truetype');
}

i {
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions css/build/global.css

Large diffs are not rendered by default.

File renamed without changes.
1 change: 0 additions & 1 deletion css/global.css

This file was deleted.

File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions index.html
Expand Up @@ -8,9 +8,9 @@
<meta name="keywords" content="NTNU trondheim Instabart student studweb it-hjelp romreservasjon campuskart karakterstatistikk">
<title>Instabart</title>
<link rel="icon" type="image/ico" href="img/favicon.ico">
<link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/build/global.css">
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="css/ie.css" />
<link rel="stylesheet" type="text/css" href="css/build/ie.css" />
<![endif]-->
</head>

Expand Down Expand Up @@ -147,7 +147,7 @@ <h2>Huske kalendernavn?</h2>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="js/global.min.js"></script>
<script src="js/build/production.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
Expand Down

0 comments on commit e7af926

Please sign in to comment.