1

I'm using metalsmith static site generators and building html/css files from jade/sass respectively.

When I compile I'm getting the following

  • .scss files as .css files
  • ._scss files are not generated as .css files, but I could include them in the .scss files. (Include sass files)
  • .jade files as .html files

I'm happy with the way that Sass works. But when I keep some include files as .jade files, the include files are also created as .html files.

Eg:


    -home.jade
    -include.jade

are converted to


    -home.html
    -include.html

but I want only


    -home.html

I do not want multiple html files in the build directory(include files should not be converted to html files).

Any help will be much appreciated.

cimmanon
  • 67,211
  • 17
  • 165
  • 171
Som
  • 270
  • 1
  • 13

2 Answers2

0

Are you using metalsmith-in-place for your templates? You could simply create a quick inline filter function to remove files that match a pattern:

function(){
  var minimatch = require("minimatch");

  return function skip(files, metalsmith, done){
    for (var file in files) {
      if (minimatch(file, "/**/_*.jade")) delete files[file];
    }

    done();
  };
}

So any file with an underscore prefix will be skipped.

Or are you using metalsmith-layouts?

Adrien
  • 667
  • 6
  • 7
0

We can create a folder for all the html-layout files and keep them outside our working directory(path should be adjusted to call the layout html in our working html files). So only the working html files will be generated and not the layout files.

Som
  • 270
  • 1
  • 13