grunt-htmlgen

Grunt task to generate HTML files with stylesheet and script elements.

grunt-htmlgen

Grunt (0.4.x) task to generate HTML files with stylesheet and script elements.

htmlgen is a multi task so any targets, files and options should be specified according to the multi task documentation.

[String] Location of the generated HTML file.

[String] Title of the page to generate (optional).

[String|Array] URL or array of URLs of stylesheets to include (optional).

[String|Array] URL or array of URLs of scripts to include (optional).

module.exports = function(grunt) {
  'use strict';

  grunt.initConfig({
    htmlgen: {
      index: {
        title: 'Title',
        css: ['styles/style1.css', 'styles/style2.css', 'styles/style3.css'],
        js: ['scripts/script1.js', 'scripts/script2.js', 'scripts/script3.js'],
        dest: 'index.html'
      }
    }
  });

  grunt.loadNpmTasks('grunt-htmlgen');
  grunt.registerTask('default', ['htmlgen']);

};
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="styles/style1.css">
<link rel="stylesheet" type="text/css" href="styles/style2.css">
<link rel="stylesheet" type="text/css" href="styles/style3.css">
</head>
<body>
<script src="scripts/script1.js"></script>
<script src="scripts/script2.js"></script>
<script src="scripts/script3.js"></script>
</body>
</html>