Skip to content

Conditional Replacement #60

@MBurchard

Description

@MBurchard

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions