Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v8.17.0
163 changes: 82 additions & 81 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function(grunt){
module.exports = function (grunt) {
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
pkg: grunt.file.readJSON('package.json'),

join: {
src: 'src',
Expand All @@ -20,16 +20,16 @@ module.exports = function(grunt){
]
}]
},
images : {
images: {
files: [{
expand: true,
dot: true,
cwd: '<%= join.src %>/images',
dest: '<%= join.dist %>/images',
src: ['**/*.{ico,png,jpg,jpeg,gif,svg}']
src: ['**/*.{ico,png,jpg,jpeg,gif,svg}']
}]
},
html : {
html: {
files: [{
expand: true,
dot: true,
Expand All @@ -38,7 +38,7 @@ module.exports = function(grunt){
src: ['**/*.html', '.htaccess']
}]
},
js : {
js: {
files: [{
expand: true,
dot: true,
Expand All @@ -56,8 +56,9 @@ module.exports = function(grunt){
src: [
'**/*.{ico,svg,txt,pdf,css}',
'.htaccess',
'CNAME',
]
}]
}]
}
},

Expand Down Expand Up @@ -92,57 +93,57 @@ module.exports = function(grunt){
},

htmlmin: {
dist: {
options: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeCommentsFromCDATA: true,
removeEmptyAttributes: true,
removeOptionalTags: true,
removeRedundantAttributes: true,
useShortDoctype: true
},
files: [{
expand: true,
cwd: '<%= join.src %>',
src: '**/*.html',
dest: '<%= join.dist %>'
}]
}
},
dist: {
options: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeCommentsFromCDATA: true,
removeEmptyAttributes: true,
removeOptionalTags: true,
removeRedundantAttributes: true,
useShortDoctype: true
},
files: [{
expand: true,
cwd: '<%= join.src %>',
src: '**/*.html',
dest: '<%= join.dist %>'
}]
}
},

imagemin: {
dist: {
options: {
optimizationLevel: 5
},
files: [{
expand: true,
cwd: '<%= join.src %>/images',
src: ['**/*.{png,jpg,gif}'],
dest: '<%= join.dist %>/images'
}]
}
dist: {
options: {
optimizationLevel: 5
},
files: [{
expand: true,
cwd: '<%= join.src %>/images',
src: ['**/*.{png,jpg,gif}'],
dest: '<%= join.dist %>/images'
}]
}
},

uglify: {
dist: {
options: {
banner: '/*! script.js 1.0.0 | Utkarsh Gupta | MIT Licensed */'
},
files : [{
files: [{
expand: true,
cwd: '<%= join.src %>/scripts',
src: ['**/*.js', '!*.min.js'],
dest: '<%= join.dist %>/scripts'
}]
}
}
},

sass: {
dist: {
files : [{
files: [{
expand: true,
cwd: 'src/styles',
src: ['**/*.scss'],
Expand All @@ -167,66 +168,66 @@ module.exports = function(grunt){
},

connect: {
options: {
port: 5000,
livereload: 35729,
hostname: '0.0.0.0',
},
livereload: {
options: {
open: true,
base: ['<%= join.dist %>'],
middleware: function (connect, options) {
if (!Array.isArray(options.base)) {
options.base = [options.base];
}
var serveStatic = require('serve-static');
var middlewares = [require('connect-livereload')()];
options.base.forEach(function(base) {
middlewares.push(serveStatic(base));
});
return middlewares;
}
}
}
},
options: {
port: 5001,
livereload: 35729,
hostname: '0.0.0.0',
},
livereload: {
options: {
open: true,
base: ['<%= join.dist %>'],
middleware: function (connect, options) {
if (!Array.isArray(options.base)) {
options.base = [options.base];
}
var serveStatic = require('serve-static');
var middlewares = [require('connect-livereload')()];
options.base.forEach(function (base) {
middlewares.push(serveStatic(base));
});
return middlewares;
}
}
}
},

watch: {
scss: {
files: 'src/styles/**/*.scss',
tasks : ['sass'],
tasks: ['sass'],
options: {
livereload: '<%= connect.options.livereload %>',
}
livereload: '<%= connect.options.livereload %>',
}
},
images: {
files: 'src/images/**/*.{png,jpeg,jpg,ico,svg}',
tasks : ['clean:images','copy:images'],
tasks: ['clean:images', 'copy:images'],
options: {
livereload: '<%= connect.options.livereload %>',
}
livereload: '<%= connect.options.livereload %>',
}
},
html: {
files: 'src/**/*.html',
tasks: ['clean:html','copy:html'],
tasks: ['clean:html', 'copy:html'],
options: {
livereload: '<%= connect.options.livereload %>',
}
livereload: '<%= connect.options.livereload %>',
}
},
js: {
files: 'src/scripts/**/*.js',
tasks: ['clean:js','copy:js'],
tasks: ['clean:js', 'copy:js'],
options: {
livereload: '<%= connect.options.livereload %>',
}
livereload: '<%= connect.options.livereload %>',
}
}
},

'gh-pages': {
options: {
base: 'dist'
},
src: ['**']
options: {
base: 'dist'
},
src: ['**']
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
Expand All @@ -239,6 +240,6 @@ module.exports = function(grunt){
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.registerTask('default',[ "clean:dist", "sass", "copy:dev", "connect:livereload", "watch" ]);
grunt.registerTask('build', [ "clean:dist", "sass", "cssmin", "uglify", "imagemin", "htmlmin", "copy:prod" ]);
grunt.registerTask('default', ["clean:dist", "sass", "copy:dev", "connect:livereload", "watch"]);
grunt.registerTask('build', ["clean:dist", "sass", "cssmin", "uglify", "imagemin", "htmlmin", "copy:prod"]);
}
16 changes: 11 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# SDSLabs Recruitment Page 2017
# SDSLabs Recruitment Page

This website is used as a registration portal during the recruitment days for the SDSLabs.

## Prerequisites

- Install node and npm.
- Install nvm.

## Setup

- Run `nvm install` to install node version 8.
- Run `npm install`.

## Development
## Development

- Run `./node_modules/.bin/grunt` to serve the site with livereload for development.
- Run `npm run dev` to serve the site with livereload for development.

## Production

- Run `./node_modules/.bin/grunt serve` to build the production website in `dist` folder.
- Run `npm run serve` to build the production website in `dist` folder.

## Deployment

- Run `npm run deploy` to deploy `dist` folder on `gh-pages` branch.
Loading