Skip to content

Conditional Replacement #60

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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