diff --git a/app/index.html b/app/index.html index b634bec..e8b4379 100644 --- a/app/index.html +++ b/app/index.html @@ -7,17 +7,19 @@ - + - - - + + + + + @@ -85,8 +87,8 @@ - + - + diff --git a/app/index.prod.html b/app/index.prod.html deleted file mode 100644 index c0ea486..0000000 --- a/app/index.prod.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
-
Recipes
-
-
- - -
- -
-
- -
-
-
- - -
-
- -
-
-
- -
-
- - - - - - - \ No newline at end of file diff --git a/app/js/shell.js b/app/js/shell.js index 86dda84..1f95864 100644 --- a/app/js/shell.js +++ b/app/js/shell.js @@ -1,3 +1,4 @@ +"use strict"; jQuery(function($) { var $bodyEl = $('body'), $sidedrawerEl = $('#sidedrawer'); diff --git a/gulpfile.js b/gulpfile.js index fa63e90..fd52b9d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -13,28 +13,34 @@ var gulp = require('gulp'), livereload = require('gulp-livereload'), htmlmin = require('gulp-htmlmin'), inject = require('gulp-inject'), - del = require('del'); + del = require('del'), + htmlreplace = require('gulp-html-replace'); +var filePath = { + build_dir: './dist' +}; gulp.task('scripts', function() { return gulp.src('app/js/**/*.js') .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('default')) .pipe(concat('main.js')) - .pipe(gulp.dest('dist/js')) - .pipe(rename({suffix: '.min'})) - .pipe(uglify()) + /*.pipe(gulp.dest('dist/js'))*/ + /*.pipe(rename({suffix: '.min'}))*/ + /* .pipe(uglify())*/ + .pipe(concat('app.js')) .pipe(gulp.dest('dist/js')) .pipe(notify({ message: 'Scripts task complete' })); }); gulp.task('styles', function() { - return gulp.src('app/css/**/*.css') + return gulp.src(['app/css/app.css','app/css/md.css','app/css/read.css','app/css/gist.css']) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) - .pipe(gulp.dest('dist/css')) - .pipe(rename({suffix: '.min'})) + /*.pipe(gulp.dest('dist/css'))*/ + /*.pipe(rename({suffix: '.min'}))*/ .pipe(cssnano()) + .pipe(concat('app.css')) .pipe(gulp.dest('dist/css')) .pipe(notify({ message: 'Styles task complete' })); }); @@ -43,12 +49,23 @@ gulp.task('partials', function() { gulp.src(['app/partials/**/*']).pipe(gulp.dest('dist/partials')); gulp.src(['app/libs/ejs_production.js']).pipe(gulp.dest('dist/libs')); + gulp.src(['app/libs/microevent.js']).pipe(gulp.dest('dist/libs')); + gulp.src(['app/fav/**/*']).pipe(gulp.dest('dist/fav')); }); -gulp.task('minify-html', function () { - return gulp.src(['app/index.prod.html']).pipe(htmlmin({removeComments: true, collapseWhitespace: true, keepClosingSlash: true})) - .pipe(gulp.dest('dist/index.html')); + +gulp.task('index', function () { + var sources = gulp.src(['js/apps.js', 'css/app.css'], {read: false}); + + return gulp.src(['app/index.html']) + .pipe(htmlreplace({ + 'css': 'css/app.css', + 'js': 'js/app.js', + 'vendor': 'libs/ejs_production.js' + })) + .pipe(htmlmin({removeComments: true, collapseWhitespace: true, keepClosingSlash: true})) + .pipe(gulp.dest('dist/')); }); gulp.task('clean', function() { @@ -57,5 +74,5 @@ gulp.task('clean', function() { gulp.task('default', ['clean'], function() { - gulp.start('styles', 'scripts','partials','minify-html'); + gulp.start('styles', 'scripts','partials','index'); }); \ No newline at end of file diff --git a/keeper-server.js b/keeper-server.js index d07fd79..5c4cd4a 100644 --- a/keeper-server.js +++ b/keeper-server.js @@ -17,7 +17,7 @@ app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use(cookieParser()); -app.use(express.static(path.join(__dirname, 'app'))); +app.use(express.static(path.join(__dirname, 'dist'))); app.use('/', keeper); diff --git a/package.json b/package.json index 27171ca..fa21271 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "gulp-cache": "^0.4.2", "gulp-concat": "^2.6.0", "gulp-cssnano": "^2.1.1", + "gulp-html-replace": "^1.5.5", "gulp-htmlmin": "^1.3.0", "gulp-inject": "^3.0.0", "gulp-jshint": "^2.0.0", diff --git a/server/keeper.js b/server/keeper.js index ada39dd..2e17f97 100644 --- a/server/keeper.js +++ b/server/keeper.js @@ -29,7 +29,7 @@ var generics = ['ARTICLE', 'div.content_column', 'div.post','div.page']; function cleaner(b) { var _b = b; - var unwanted = ['div#disqus_thread', 'SCRIPT', 'FOOTER', 'div.ssba', '.shareaholic-canvas', '.yarpp-related', 'div.dfad', 'div.postFooterShare', 'div#nextPrevLinks', '.post-comments','HEADER', '.post-title','#side-menu','.footer-container','#pre-footer','#cakephp-global-navigation', '.masthead','.breadcrumb']; + var unwanted = ['div#disqus_thread', 'SCRIPT', 'FOOTER', 'div.ssba', '.shareaholic-canvas', '.yarpp-related', 'div.dfad', 'div.postFooterShare', 'div#nextPrevLinks', '.post-comments','HEADER', '.post-title','#side-menu','.footer-container','#pre-footer','#cakephp-global-navigation', '.masthead','.breadcrumb-header']; for (var i = 0; i < unwanted.length; i++) { _b.find(unwanted[i]).remove();