Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Motil
authored and
Eric Motil
committed
Nov 4, 2015
0 parents
commit 15d3da3
Showing
42 changed files
with
401 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Dependency directories | ||
node_modules | ||
bower_components | ||
|
||
# Compiled | ||
dist | ||
dist/**/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
'use strict'; | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Dependencies | ||
// ----------------------------------------------------------------------------- | ||
|
||
var gulp = require('gulp'); | ||
var sass = require('gulp-sass'); | ||
var autoprefixer = require('gulp-autoprefixer'); | ||
var sassdoc = require('sassdoc'); | ||
var browserSync = require('browser-sync').create(); | ||
var nunjucksRender = require('gulp-nunjucks-render'); | ||
var concat = require('gulp-concat'); | ||
var imagemin = require('gulp-imagemin'); | ||
var pngquant = require('imagemin-pngquant'); | ||
var siteOutput = './dist'; | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Configuration | ||
// ----------------------------------------------------------------------------- | ||
|
||
var input = './scss/*.scss'; | ||
var inputMain = './scss/main.scss'; | ||
var output = siteOutput + '/css'; | ||
var inputTemplates = './pages/*.html'; | ||
var sassOptions = { outputStyle: 'expanded' }; | ||
var autoprefixerOptions = { browsers: ['last 2 versions', '> 5%', 'Firefox ESR'] }; | ||
var sassdocOptions = { dest: siteOutput + '/sassdoc' }; | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Sass compilation | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('sass', function() { | ||
return gulp | ||
.src(inputMain) | ||
.pipe(sass(sassOptions).on('error', sass.logError)) | ||
.pipe(autoprefixer(autoprefixerOptions)) | ||
.pipe(gulp.dest(output)) | ||
.pipe(browserSync.stream()); | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Javascript | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('scripts', function() { | ||
return gulp.src([ | ||
'./bower_components/bootstrap-sass/assets/javascripts/bootstrap.js', | ||
'js/main.js' | ||
]) | ||
.pipe(concat({ path: 'main.js'})) | ||
.pipe(browserSync.reload({stream:true})) | ||
.pipe(gulp.dest(siteOutput + '/js')); | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Templating | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('nunjucks', function() { | ||
nunjucksRender.nunjucks.configure(['./templates/']); | ||
// Gets .html and .nunjucks files in pages | ||
return gulp.src(inputTemplates) | ||
// Renders template with nunjucks | ||
.pipe(nunjucksRender()) | ||
// output files in dist folder | ||
.pipe(gulp.dest(siteOutput)) | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Imagemin | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('img', function() { | ||
return gulp.src('./img/**/*') | ||
.pipe(imagemin({ | ||
progressive: true, | ||
svgoPlugins: [{removeViewBox: false}], | ||
use: [pngquant()] | ||
})) | ||
.pipe(gulp.dest(siteOutput + '/img')); | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Fonts | ||
// ----------------------------------------------------------------------------- | ||
|
||
// gulp.task('fonts', function() { | ||
// return gulp.src(['./fonts/*']) | ||
// .pipe(gulp.dest(siteOutput + '/fonts/')); | ||
// }); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Sass documentation generation | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('sassdoc', function() { | ||
return gulp | ||
.src(input) | ||
.pipe(sassdoc(sassdocOptions)) | ||
.resume(); | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Watchers | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('watch', function() { | ||
// Watch the sass input folder for change, | ||
// and run `sass` task when something happens | ||
gulp.watch(input, ['sass']).on('change', function(event) { | ||
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); | ||
}); | ||
|
||
gulp.watch('./js/*', ['scripts']).on('change', browserSync.reload); | ||
|
||
// Watch nunjuck templates and reload browser if change | ||
gulp.watch(inputTemplates, ['nunjucks']).on('change', browserSync.reload); | ||
|
||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Static server | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('browser-sync', function() { | ||
browserSync.init({ | ||
server: { | ||
baseDir: siteOutput | ||
} | ||
}); | ||
}); | ||
|
||
|
||
// ----------------------------------------------------------------------------- | ||
// Default task | ||
// ----------------------------------------------------------------------------- | ||
|
||
gulp.task('default', ['sass', 'nunjucks', 'scripts', 'img', 'watch', 'browser-sync']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SVMIC | ||
|
||
A nice little Gulp project using [Nunjucks](http://mozilla.github.io/nunjucks/),[SASS](http://sass-lang.com/) and [Gulp](http://gulpjs.com/). Browsersync runs out of 'dist' folder and watches all Nunjucks templates, SASS and JS and live reloads in browser on change. Also worked in some img min and moving fonts and assets to a 'dist' folder for easy deployment. | ||
|
||
|
||
Gulp tasks used: | ||
- sass | ||
- autoprefixer | ||
- sassdoc | ||
- browserSync | ||
- nunjucksRender | ||
- script concat | ||
- imagemin | ||
- pngquant | ||
|
||
|
||
## Setup | ||
|
||
1) Install [Gulp](http://gulpjs.com/) and [NPM]('http://nodejs.org') if you do not already have them. | ||
|
||
2) Install npm dependencies | ||
``` | ||
npm install | ||
``` | ||
|
||
3) Install bower components | ||
``` | ||
bower install | ||
``` | ||
|
||
$) Run Gulp | ||
``` | ||
gulp | ||
``` | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<browserconfig> | ||
<msapplication> | ||
<tile> | ||
<square70x70logo src="/mstile-70x70.png"/> | ||
<square150x150logo src="/mstile-150x150.png"/> | ||
<square310x310logo src="/mstile-310x310.png"/> | ||
<wide310x150logo src="/mstile-310x150.png"/> | ||
<TileColor>#da532c</TileColor> | ||
</tile> | ||
</msapplication> | ||
</browserconfig> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "svmic", | ||
"icons": [ | ||
{ | ||
"src": "\/android-chrome-36x36.png", | ||
"sizes": "36x36", | ||
"type": "image\/png", | ||
"density": "0.75" | ||
}, | ||
{ | ||
"src": "\/android-chrome-48x48.png", | ||
"sizes": "48x48", | ||
"type": "image\/png", | ||
"density": "1.0" | ||
}, | ||
{ | ||
"src": "\/android-chrome-72x72.png", | ||
"sizes": "72x72", | ||
"type": "image\/png", | ||
"density": "1.5" | ||
}, | ||
{ | ||
"src": "\/android-chrome-96x96.png", | ||
"sizes": "96x96", | ||
"type": "image\/png", | ||
"density": "2.0" | ||
}, | ||
{ | ||
"src": "\/android-chrome-144x144.png", | ||
"sizes": "144x144", | ||
"type": "image\/png", | ||
"density": "3.0" | ||
}, | ||
{ | ||
"src": "\/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image\/png", | ||
"density": "4.0" | ||
} | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// main.js | ||
|
||
$(document).ready(function (){ | ||
console.log('document is ready bitch'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "svmic", | ||
"version": "1.0.0", | ||
"description": "svmic", | ||
"main": "index.html", | ||
"scripts": { | ||
"test": "ok" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "nope" | ||
}, | ||
"keywords": [ | ||
"insurance" | ||
], | ||
"author": "eric motil", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"browser-sync": "^2.9.11", | ||
"gulp": "^3.9.0", | ||
"gulp-autoprefixer": "^3.1.0", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-imagemin": "^2.3.0", | ||
"gulp-nunjucks-render": "^1.0.0", | ||
"gulp-sass": "^2.1.0", | ||
"imagemin-pngquant": "^4.2.0", | ||
"sassdoc": "^2.1.15" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!-- index.nunjucks --> | ||
{% extends "default.html" %} | ||
{% block content %} | ||
|
||
<h1>Hello</h1> | ||
<img src="/img/friday.gif" width="100%"/> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// base.scss | ||
|
||
html, body { | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// main.scss | ||
|
||
// Imports | ||
@import 'base'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
{% include "partials/head.html" %} | ||
|
||
<body> | ||
|
||
{% block content %}{% endblock %} | ||
|
||
{% include "partials/end.html" %} | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | ||
<script src="/js/main.js"></script> |
Oops, something went wrong.