-
Notifications
You must be signed in to change notification settings - Fork 94
Description
During development If we edit a blog post in a way that changes the pathname (for instance editing pathname in front matter) the rendered list of posts will have the old and new entries.
The reason is that POSTS is a map of pathname to Post and when the pathname changes the old post (under the old pathname) is not updated or removed.
Since the watchFs event does not return the old state of the file we don't really know what changed.
I think maybe a Map<string, string> of filename to pathname can help, when this file changes we remove the pathname entry from POSTS (since we know the old pathname) before loadPost.
I did not check yet but I think the worst case is rename, in this case we would need to scan all files and check which filename is not present and delete it from POSTS.