I'm using gulp to render haml using gulp-haml-coffee
I want to do something like this:
header.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Website Title</title>
<link rel="stylesheet" href="style.css?v=1.0">
</head>
home.haml
INCLUDE header.html
.content
Regular Haml Content
INCLUDE footer.html
footer.html
</body>
</html>
The tricky part for me is that it is a mix of HTML and Haml and I want them to be combined into one file automatically using Gulp.
Here is the current Gulp task:
// HAML
gulp.task('haml', function() {
return gulp.src('app/source/**/*.haml')
.pipe(customPlumber('HAML Error'))
.pipe(sourcemaps.init())
.pipe(haml({trace:true}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./app/compiled'))
.pipe(browserSync.reload({
stream: true
}))
});
The haml conversion is working but I can't figure out how to include plain HTML files as part of the conversion.
I'm going to be creating several other haml files (about, contact, etc.)
This is what I would want the rendered HTML to be:
home.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Website Title</title>
<link rel="stylesheet" href="style.css?v=1.0">
</head>
<div class="content">
Regular Haml Content
</div>
</body>
</html>