Some changes

This commit is contained in:
unknown 2015-07-27 09:49:42 +02:00
parent ea63243d6a
commit 00fd6f5d52
4 changed files with 119 additions and 85 deletions

View File

@ -1,70 +1,86 @@
// Require all those npm-modules // Require all those npm-modules
var gulp = require('gulp'), var gulp = require('gulp'),
sass = require('gulp-sass'), sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'), autoprefixer = require('gulp-autoprefixer'),
cssmin = require('gulp-cssmin'), cssmin = require('gulp-cssmin'),
jshint = require('gulp-jshint'), jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'), uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'), imagemin = require('gulp-imagemin'),
pngcrush = require('imagemin-pngcrush'), pngcrush = require('imagemin-pngcrush'),
rename = require('gulp-rename'), rename = require('gulp-rename'),
clean = require('gulp-rimraf'), del = require('del'),
concat = require('gulp-concat'), concat = require('gulp-concat'),
notify = require('gulp-notify'), notify = require('gulp-notify'),
cache = require('gulp-cache'), cache = require('gulp-cache'),
livereload = require('gulp-livereload'); livereload = require('gulp-livereload'),
plumber = require('gulp-plumber');
// render scss // render scss
gulp.task('styles', function() { gulp.task('styles', function() {var onError = function(err) {
gulp.src('./src/scss/main.scss') notify.onError({
.pipe(sass({ style: 'expanded' })) title: "Gulp",
.pipe(autoprefixer('last 2 version', 'IE 9', 'safari 5', 'Firefox ESR', 'opera 12.1', 'ios 6', 'android 4', 'BlackBerry 10')) subtitle: "Failure!",
.pipe(gulp.dest('./css')) message: "Error: <%= error.message %>",
.pipe(rename({suffix: '.min'})) sound: "Submarine"
.pipe(cssmin()) })(err);
.pipe(gulp.dest('./css'))
.pipe(notify({ message: 'Styles task complete' })); this.emit('end');
};
gulp.src('./src/scss/blacktie.scss')
.pipe(plumber({errorHandler: onError}))
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer('last 2 version', 'IE 9', 'safari 5', 'Firefox ESR', 'opera 12.1', 'ios 6', 'android 4', 'BlackBerry 10'))
.pipe(gulp.dest('./css'))
.pipe(rename({suffix: '.min'}))
.pipe(cssmin())
.pipe(gulp.dest('./css'))
.pipe(notify({ message: 'Styles task complete' }));
}); });
// compress images // compress images
gulp.task('images', function() { gulp.task('images', function() {
gulp.src('./src/img/*') gulp.src('./src/img/*')
.pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))) .pipe(cache(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true })))
.pipe(gulp.dest('./img/')) .pipe(gulp.dest('./img/'))
.pipe(notify({ message: 'Images task complete' })); .pipe(notify({ message: 'Images task complete' }));
}); });
// clean the folders
gulp.task('clean', function() {
gulp.src(['./css/*', './js/*', './img/*'], {read: false})
.pipe(clean());
});
// do the javascript-dance // do the javascript-dance
gulp.task('scripts', function() { gulp.task('scripts', function() {
gulp.src('./src/js/**/*.js') gulp.src('./src/js/**/*.js')
.pipe(concat('main.js')) .pipe(concat('main.js'))
.pipe(gulp.dest('./js')) .pipe(gulp.dest('./js'))
.pipe(rename({suffix: '.min'})) .pipe(rename({suffix: '.min'}))
.pipe(uglify()) .pipe(uglify())
.pipe(gulp.dest('./js')) .pipe(gulp.dest('./js'))
.pipe(notify({ message: 'Scripts task complete' })); .pipe(notify({ message: 'Scripts task complete' }));
}); });
// watch it while working // watch it while working
gulp.task('watch', function() { gulp.task('watch', function() {
// Watch .scss files // Watch .scss files
gulp.watch('src/scss/**/*.scss', ['styles']); gulp.watch('src/scss/**/*.scss', ['styles']);
// Watch .js files // Watch .js files
gulp.watch('src/js/**/*.js', ['scripts']); gulp.watch('src/js/**/*.js', ['scripts']);
// Watch image files // Watch image files
gulp.watch('src/img/**/*', ['images']); gulp.watch('src/img/**/*', ['images']);
}); });
// clean the folders
gulp.task('clean', function(cb) {
del(['./css/*', './js/*', './img/*'], cb)
});
// default: all of them! \o/ // default: all of them! \o/
gulp.task('default', ['clean'], function() { gulp.task('default', ['clean'], function() {
gulp.start('styles', 'scripts', 'images'); gulp.start('styles', 'scripts', 'images');
}); });

View File

@ -1,24 +1,29 @@
<!DOCTYPE html> <!doctype html>
<html lang="de"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<title>Title goes here</title> <title>Title goes here</title>
<meta name="description" content="description goes here " />
<link rel="dns-prefetch" href="//fonts.googleapis.com"> <meta name="author" content="Jan Jastrow" />
<link rel="dns-prefetch" href="//schwerkraftlabor.de"> <link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="shortcut icon" href="favicon.ico" /> <link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="css/main.css" rel="stylesheet" /> <meta http-equiv="x-ua-compatible" content="ie=edge" />
<link type="text/plain" rel="author" href="humans.txt" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="favicon.ico" />
<meta name="description" content="Description goes here." /> <link type="text/css" rel="stylesheet" href="css/blacktie.css" />
<meta name="author" content="Jan Jastrow" /> <link type="text/plain" rel="author" href="humans.txt" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <link href='http://fonts.googleapis.com/css?family=Exo+2:700|Titillium+Web:400,700' rel='stylesheet' type='text/css'>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
</head> </head>
<body> <body>
<div id="wrap">
<header>
<script src="instantclick.min.js" data-no-instant></script> <h1>Headline</h1>
<script data-no-instant>InstantClick.init();</script> </header>
<main>
<article class="">
Welcome!
</article>
</main>
</div>
</body> </body>
</html> </html>

View File

@ -2,23 +2,37 @@
"name": "ProjectName", "name": "ProjectName",
"description": "Project description", "description": "Project description",
"version": "1.0.0", "version": "1.0.0",
"author": "Jan Jastrow",
"license": "MIT",
"homepage": "projecturl", "homepage": "projecturl",
"url" : "http://github.com/Gehirnfussel/project/issues", "url" : "http://github.com/Gehirnfussel/project/",
"email" : "jan@schwerkraftlabor.de", "email" : "jan@schwerkraftlabor.de",
"devDependencies": { "scripts": {},
"gulp": "~3.8.6", "main": "gulpfile.js",
"gulp-sass": "~0.7.2", "repository": {
"gulp-autoprefixer": "~0.0.8", "type": "git",
"gulp-cssmin": "~0.1.6", "url": "https://bitbucket.org/Gehirnfussel/project"
"gulp-jshint": "~1.8.0", },
"gulp-uglify": "~0.3.1", "dependencies": {},
"gulp-imagemin": "0.6.2", "devDependencies": {
"gulp-concat": "~2.3.4", "del": "^0.1.3",
"gulp-rename": "~1.2.0", "gulp": "^3.8.10",
"gulp-rimraf": "~0.1.0", "gulp-autoprefixer": "^2.0.0",
"gulp-watch": "~0.6.9", "gulp-cache": "^0.2.4",
"gulp-cache": "~0.2.0", "gulp-concat": "^2.4.2",
"gulp-notify": "~1.4.0", "gulp-cssmin": "^0.1.6",
"gulp-livereload": "~2.1.0", "gulp-imagemin": "^2.0.0",
} "gulp-jshint": "^1.9.0",
"gulp-livereload": "^3.0.2",
"gulp-minify-css": "^0.3.11",
"gulp-notify": "^2.1.0",
"gulp-plumber": "^0.6.6",
"gulp-rename": "^1.2.0",
"gulp-ruby-sass": "^0.7.1",
"gulp-sass": "^1.2.4",
"gulp-uglify": "^1.0.2",
"gulp-watch": "^3.0.0",
"imagemin-jpegtran": "^4.0.0",
"imagemin-pngcrush": "^4.0.0"
},
} }

View File

@ -1,4 +1,3 @@
# www.robotstxt.org/ # www.robotstxt.org/
# http://code.google.com/web/controlcrawlindex/ # http://code.google.com/web/controlcrawlindex/
User-agent: * User-agent: *