cobalt-org / cobalt.rs

Static site generator written in Rust
cobalt-org.github.io/
Apache License 2.0
1.37k stars 102 forks source link

cobalt serve shouldn't rebuild when an ignored files change #1197

Open skierpage opened 3 months ago

skierpage commented 3 months ago
% cd myBlog
% cobalt serve &
Watching "/tmp/myBlog" for changes
Serving /tmp/.tmpKWpOeX through static file server
Server Listening on http://localhost:1024
Ctrl-c to stop the server
Watching "/tmp/myBlog" for changes

% touch _IGNORED_FILE
Building from `/tmp/myBlog` into `/tmp/.tmpKWpOeX`

Expected result:

If a file is ignored by cobalt serve and cobalt build and is not a directory or file known to Cobalt such as _cobalt.yml, _defaults, and _layouts, then changing it should not trigger a rebuild.

Cobalt is so fast to rebuild that this is a minor bug.

epage commented 3 months ago

This is because we build from files that are also ignored.

What I would like to do is restructure things is to rebuild incrementally. So if we kick off a rebuild for an ignored file, nothing would change. When we kick off a build for a source file, only the relevant parts of the site would rebuild.