metalsmith-browser-sync icon indicating copy to clipboard operation
metalsmith-browser-sync copied to clipboard

collection is appended at each change

Open oupala opened this issue 9 years ago • 1 comments

I have a strange behaviour here while replacing watch and serve plugins by browsersync plugin.

I have a collection of documents which are lister on the front page.

When I run metalsmith-broswersync, each time a change is detected and the updated website a reloaded, the whole collection of documents is appended to itself and then I can find each document in double. When I modify a document one more time, the whole collection of documents is appended to itself one again, and each document is now present three times. And this goes again and again each I change a file.

Do you know if this is a desired behaviour, or a bug? Is there any workaround for this?

oupala avatar May 02 '16 14:05 oupala

Likely related to this [currently] unmerged metalsmith-collections bug .

The article cache isn't cleared so calling .build() results in the same articles being added to the collection again.

jckw avatar Feb 27 '17 19:02 jckw