Question

I am just now getting into GruntJS, and LOVING it! I have my HTML code divided into a bunch of partials for header, navbar, footer, sidebar, etc. I use @includes to pull in the relevant partials for each page, and was using Codekit (Mac) to compile them into a single HTML file. I would like to use GruntJS to do this for me instead, and my question is this: Which Grunt plugin is best for this? I searched the plugin directory and found a lot of options, with varying degrees of complexity. Is there a simple plugin that just compiles HTML files without the need for a bunch of programmatic acrobatics?

I looked at the Assemble plugin, and honestly it looks way too complicated for this, and requires the use of Yeoman and Bower. I am not planning to write any javascript code for this site.

Was it helpful?

Solution

Have a look at grunt-includes; this matches the simple Codekit style of including content from other paths like so:

<html>
<head>
  <title>Show me</title>
</head>
<body>
  include "content.html"
</body>
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top