lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.76k stars 75 forks source link

Hide or de-emphasize live changes on unused data files #245

Closed SheetJSDev closed 1 year ago

SheetJSDev commented 1 year ago

Numbers creates a temporary file in the same folder whenever you save. Lume shows both changes, as demonstrated in the video (repro https://docs.sheetjs.com/docs/demos/content#lume-demo)

Since all loaders must register file extensions, Lume should know which data changes will affect pages and which won't. Ideally the other changes wouldn't be displayed or they would be shown in a different color.

https://user-images.githubusercontent.com/6070939/186775098-5380cf5d-1432-4fce-b99f-baf2d1d3723f.mov

oscarotero commented 1 year ago

The file watcher is independent of the registered extensions, but it's possible to configure the watcher to ignore some files using a function. For example:

const site = lume({
  watcher: [
    (path: string) => path.startsWith("/_data/press.numbers.")
  ]
});

I see that functions are not documented (only paths as string), I'll add it.

BTW, nice project, I'm thinking of creating a Lume plugin to use sheetjs :)

SheetJSDev commented 1 year ago

Looks like the docs page was updated with an example. A .lumeignore file akin to .gitignore would be a nice addition but that's for another day.