gulp.task('angularjs:html', () => {
  /* Template */
  gulp.src(['src/angularjs/**/*.html', '!src/angularjs/elements/*.html', '!src/angularjs/components/*.html', '!src/angularjs/components/index.html'])
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(htmlhint({
      "doctype-first": false,
      "attr-no-duplication": false
    }))
    .pipe(htmlhint.reporter())
    .pipe(templateCache({
      module: 'app.templates',
      standalone: true
    }))
    .pipe(gulp.dest('temp/angularjs/js'))

  /* Index */
  return gulp.src(['src/angularjs/index.html'])
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(htmlhint())
    .pipe(htmlhint.reporter())
    .pipe(gulp.dest('temp/angularjs/'))
});
Example #2
0
gulp.task('html', function () {
    gulp.src(paths.loginHtml)
        .pipe(fileinclude())
        .pipe(gulp.dest(paths.indexDest));

    return gulp.src(paths.indexHtml)
        .pipe(fileinclude())
        //.pipe(minifyHTML())
        .pipe(gulp.dest(paths.indexDest));
});
Example #3
0
gulp.task('include', function () {
  return gulp.src(folders.layouts + '/index.html')
    .pipe(fileinclude({
      basepath: folders.layouts + '/views/' + page + '.html'
    }))
    .pipe(fileinclude({
      prefix: '##'
    }))
    .pipe(dom(function () {
      this.querySelectorAll('body')[0].className = 'view-' + page;
      return this;
    }))
    .pipe(gulp.dest(folders.dest));
});
Example #4
0
gulp.task('blog', ['blog-posts-list'], function () {
  // taking the blog post list from the 'blog-posts-list' step
  // and including it into the blog.html template
  return gulp.src('src/blog/blog.html')
    .pipe(es.map(function (file, cb) {
      // first inject the build destination so include knows where to go
      var html = mustache.render(
        String(file.contents), {
          buildDest: config.buildDest
        });
      file.contents = new Buffer(html);
      cb(null, file);
    }))
    // then actually include the headers, navs, blogposts, footer and tail
    .pipe(fileInclude())
    // then set the title
    .pipe(es.map(function (file, cb) {
      var html = mustache.render(
        String(file.contents), {
          title: 'Blog'
        });
      file.contents = new Buffer(html);
      cb(null, file);
    }))
    // now we have /blog tada
    .pipe(rename('blog/index.html'))
    .pipe(gulp.dest(destination));
});
Example #5
0
gulp.task('html', ['blog'], function () {
  var dir = '';
  return gulp.src('src/html/**/*.html')
    .pipe(frontMatter({
      property: 'frontMatter',
      remove: true
    }))
    .pipe(fileInclude())
    .pipe(es.map(function (file, cb) {
      var html = mustache.render(
        String(file.contents), {
          title: file.frontMatter.title
        });
      file.contents = new Buffer(html);
      cb(null, file);
    }))
    .pipe(gulpif(isProduction, gzip()))
    // rename the destination path for the file (avoiding .html)
    // unless it is index.html in which case just ignore it
    .pipe(rename(function (path) {
      if (path.basename !== 'index') {
        path.dirname = path.dirname + '/' + path.basename;
        path.basename = "index";
        path.extname = ".html";
      }
    }))
    .pipe(gulp.dest(destination));
});
Example #6
0
gulp.task('templates', function () {
    gulp.src(['src/example/index.html'])
        .pipe(fileInclude({
            template: '<script type="text/template" id="@filename"> @content </script>'
        }))
        .pipe(gulp.dest('example/'));
});
Example #7
0
gulp.task('html:build', function () {
  gulp.src(path.src.html) //Выберем файлы по нужному пути
    //.pipe(rigger()) //Прогоним через rigger
    .pipe(include({prefix: '@@'}))
    .pipe(gulp.dest(path.build.html)) //Выплюнем их в папку build
    .pipe(reload({stream: true})); //И перезагрузим наш сервер для обновлений
});
Example #8
0
gulp.task('konstrui', function(){
	gulp.src('fontkodo/cxefa.html')
		.pipe(fileinclude({
			prefix: '@@', basepath:'@file'
			}))
		.pipe(gulp.dest('rezulto'));
});
Example #9
0
gulp.task('html', function() {
  gulp.src(paths.copyElements)
    .pipe(plumber())
    .pipe(fileinclude())
    .pipe(gulp.dest('public'))
    .pipe(reload({stream:true}));
});
Example #10
0
 gulp.task('inject', ['scripts', 'styles'], function() {
     var injectStyles = gulp.src([
         options.tmp + '/serve/app/**/*.css',
         '!' + options.tmp + '/serve/app/vendor.css'
     ], {
         read: false
     });
     var injectHtmls = gulp.src([options.src + '/**/*.html'])
         .pipe(fileinclude())
         .pipe(gulp.dest(options.tmp + '/serve/src'));
     var injectScripts = gulp.src([
             options.src + '/app/**/*.js',
             '!' + options.src + '/app/**/*.spec.js',
             '!' + options.src + '/app/**/*.mock.js'
         ])
         .pipe($.angularFilesort()).on('error', options.errorHandler('AngularFilesort'));
     var injectOptions = {
         ignorePath: [options.src, options.tmp + '/serve'],
         addRootSlash: false
     };
     return gulp.src(options.src + '/**/*.html')
         .pipe($.inject(injectHtmls, injectOptions))
         .pipe($.inject(injectStyles, injectOptions))
         .pipe($.inject(injectScripts, injectOptions))
         .pipe(wiredep(options.wiredep))
         .pipe(gulp.dest(options.tmp + '/serve'));
 });
Example #11
0
gulp.task('html', function(){
	gulp.src('src/html/index.html')
		.pipe(fileinclude())
		.pipe(gulp.dest("dist/"))
		.pipe(rev())
		.pipe(gulp.dest('dist/'));
});
Example #12
0
gulp.task('html', ['html:lint'], function() {
    return gulp.src(config.paths.html.src + '/*.html')
        // File include
        .pipe(fileinclude({
            prefix: '@@',
            basepath: '@file',
            filters: {
                markdown: markdown.parse
            }
        }).on('error', function(err){
            notifyUser('Html', 'Html include failed!');
            logger.error('Html lint failed: ' + err.message, null, 'gulp html');
            this.emit('end');
        }))
        // Minify html
        .pipe( $.if(
            config.html.compilation.htmlmin.enabled,
            $.htmlmin(config.html.compilation.htmlmin.options)
            .on('error', function(err) {
                notifyUser('Html', 'Error during minification.');
                logger.error('html minification error: ' + err.message, null, 'gulp html');
                this.emit('end');
            })
        ) )
        // Usemin
        .pipe($.usemin({
            css: ['concat', $.rev()],
            html: [$.htmlmin(config.html.compilation.htmlmin.options)],
            js: [$.rev()]
        }))
        // Move to dist folder
        .pipe(gulp.dest(config.paths.html.dist));
});
Example #13
0
 function getHTML(){
   return gulp.src(['./temp/**/*.html'])
   .pipe(fileinclude({
     prefix: '@@',
     basepath: '@file'
   }));
 }
Example #14
0
gulp.task('html:footer', function() {
  var assets = $.useref.assets({
    searchPath: '{build,src,public}'
  });

  return gulp.src(config.templates + '/cat-footer.html')
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(assets)
    .pipe($.if(config.map, $.sourcemaps.init()))
    .pipe($.if('**/*main.js', $.ngAnnotate()))
    .pipe($.if('*.js', $.uglify({
      mangle: false,
    })))
    .pipe($.if('*.css', $.csso()))
    .pipe($.if(['**/*main.js', '**/*main.css'], $.header(config.banner, {
      pkg: pkg
    })))
    .pipe($.rev())
    .pipe(assets.restore())
    .pipe($.useref())
    .pipe($.revReplace())
    // .pipe($.if('*.html', $.minifyHtml({
      // empty: true
    // })))
    .pipe($.if(config.map, $.sourcemaps.write()))
    .pipe(gulp.dest(config.distTmp))
    .pipe($.size({
      title: 'html'
    }));
});
Example #15
0
gulp.task('html', () => {
  return gulp.src('src/html/**/*.html')
    .pipe(plumber({ errorHandler: onError }))
    .pipe(include({ prefix: '@', basepath: 'dist/' }))
    .pipe(htmlmin({ collapseWhitespace: true, removeComments: true }))
    .pipe(gulp.dest('dist'))
})
Example #16
0
gulp.task('fileinclude', function() {
  // grab 'template'
  gulp.src('templates/layouts/*.tpl.html')

  // include partials
  .pipe(fileinclude({
    basepath: 'templates/components/'
  }))

  // remove .tpl.html extension name
  .pipe(rename({
    extname: ""
  }))

  // add new extension name
  .pipe(rename({
    extname: ".html"
  }))

  // move file to folder
  .pipe(gulp.dest('dist/'))

  // notify to say the task has complete
  .pipe(notify({
    message: 'Template file includes complete'
  }))
});
Example #17
0
gulp.task("js", function () {
    gulp.src("resources/javascript/app/build.js")
        .pipe(fileinclude())
        .pipe(babel())
        .pipe(rename("app.js"))
        .pipe(gulp.dest("app/js"));
});
Example #18
0
gulp.task('build', function() {
  gulp.src([htmlTemplates + '*.tpl.html'])
    .pipe(fileinclude())
    .pipe(rename({extname: ""}))
    .pipe(rename({extname: ".html"}))
    .pipe(gulp.dest('./'));
});
Example #19
0
gulp.task('build', ['clean'], function() {
  gulp.src('lib/index.js')
      .pipe(include({
        prefix: '//',
        basepath: 'lib'
      }))
      .pipe(gulp.dest('bin'));
});
Example #20
0
gulp.task("fileinclude", function () {
    gulp.src(['./src/**/*.html'])
        .pipe(fileinclude({
            prefix: '@@',
            basepath: '@file'
        }))
        .pipe(gulp.dest("dist/"));
});
Example #21
0
gulp.task('fileinclude', function() {
  gulp.src(['src/pages/uidemo/*.html'])
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(gulp.dest('dist/pages/'));
});
Example #22
0
gulp.task('html', function () {
  return gulp.src(config.src)
    .pipe(fileInclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(gulp.dest(config.dest));  
});
Example #23
0
gulp.task('fileinclude', function() {
  gulp.src(['./*.html'])
  .pipe(fileinclude({
    prefix: '@@',
    basepath: 'src/includes/'
  }))
  .pipe(gulp.dest(directory));
});
Example #24
0
gulp.task('fileinclude', function() {
  gulp.src(['clickmechanic/views/*.html'])
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(gulp.dest('clickmechanic/views/build'));
});
Example #25
0
 gulp.task('include', ['markdown'], function() {
     gulp.src(['src/doc/index.html'])
         .pipe(fileinclude({
             prefix: '@@',
             basepath: '@file'
         }))
         .pipe(gulp.dest('dist/doc'));
 });
Example #26
0
gulp.task('index', function() {
  return gulp.src(PATHS.index.src)
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@root'
    }))
    .pipe(gulp.dest(PATHS.index.dest));
});
gulp.task('template', function() {
	gulp.src(['./templates/index.html'])
		.pipe(fileinclude({
			prefix: '@@',
			basepath: './templates/'
		}))
		.pipe(gulp.dest('./'));
});
Example #28
0
gulp.task('html' , function(){
	return gulp.src( htmlPath.src )
		.pipe(fileinclude({
			prefix: '@@'
		}))
		.on('error' , errorLog )
		.pipe(gulp.dest( htmlPath.dst ));
});
Example #29
0
gulp.task('fileinclude', function (){
    return gulp.src('./views/*.html')
        .pipe(fileinclude({
            prefix: '@@',
            basepath: '@file'
        }))
        .pipe(gulp.dest('./build/views'));
});
Example #30
0
gulp.task('build:html', function(){
  return gulp.src("src/pages/**/*.html")
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(gulp.dest("dist/pages"));
});