gulp-html-replace icon indicating copy to clipboard operation
gulp-html-replace copied to clipboard

Conditional Replacement

Open MBurchard opened this issue 7 years ago • 0 comments

I use gulp-html-replace in a small static page. It consists of 7 different pages with a bootstrap navigation. I want to set the CSS class "active" for different HTML pages in the appropriate navigation and load the entire navigation from a template like I did with the footer.

gulp.task('buildHTML', function() {
	gulp.src('src/html/*.html')
		.pipe(htmlreplace({
			footer: gulp.src('src/html/parts/footer.part.html'),
			js: {
				src: ['jquery-3.2.1.min.js', 'bootstrap.min.js'],
				tpl: '<script type="text/javascript" src="/js/%s"></script>'
			}
		}))
		.pipe(gulp.dest(rootDir + '/'));
});

Is this possible?

MBurchard avatar Dec 11 '17 11:12 MBurchard