kalamuna / metalsmith-jstransformer

Metalsmith JSTransformers Plugin
http://npm.im/metalsmith-jstransformer
MIT License
7 stars 9 forks source link

Delete plugin auxiliary metadata from files #22

Closed ycherniavskyi closed 7 years ago

ycherniavskyi commented 7 years ago

If found possibility to resolve #18 in minor harm way - just delete auxiliary metadata from files after plugin finishes its work. So with such fix plugin could be called as many time as needed.

I tried to implement the test for this functionality, but without changing plugins parameter of test function from Object to Array it seems not possible (because this test must use the same plugin .. several times).

ycherniavskyi commented 7 years ago

With this functionality my current usage looks something like this:

...

metalsmith
  .use($m.jstransformer({
    pattern: '**.html.md',
    layoutPattern: '!**',
  }));

metalsmith
  .use($m.branch('blog/*/**')
    .use($m.wordCount())
    .use($m.betterExcerpts())
  );

metalsmith
  .use($m.jstransformer({
    pattern: '**.html*',
    layoutPattern: 'layouts/**',
  }));

...
RobLoach commented 7 years ago

Good call, we don't need that cached information. Nicely done! :+1: