You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 ofpathname
toPost
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 fromPOSTS
(since we know the old pathname) beforeloadPost
.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 fromPOSTS
.The text was updated successfully, but these errors were encountered: