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
With the current watch system, images reload in the browser when they are changed.
However, any owning document is not updated, so if the image size changes, the document will still display the image at the old size, until the document itself is resaved.
Proposal
The only way for content documents to be successfully updated, would be to store a reverse lookup of which images are in which documents:
for any found assets, the document id is inserted into the asset's metadata
When images are changed:
the image asset index is updated with the new metadata
related documents should be are re-parsed, updating image sizes in matching paths
When assets are deleted or moved:
the document list for each individual asset should be modified
related documents should be re-parsed, replacing old asset paths with the new asset paths
The thing to remember about moves is that they are reported by chokidar as a delete then an update, so does this change how paths should be rewritten, or is this only a concern for the user?
Also, it's possible that document moves would need to trigger this as well (should check if moves trigger the parsing hook).
Also, note that this only needs to happen if image size hints are on.
Otherwise, the image size should update automatically.
Notes
Consider if this would create problems if the related documents are open but not saved.
The target documents would need to be reloaded. Check live-reload section of #18 to see how this might be done.
The text was updated successfully, but these errors were encountered:
It looks like the refresh functionality is not going to work right now, as Nuxt Content is already refreshing saved content, even though it is ignored.
Background
With the current watch system, images reload in the browser when they are changed.
However, any owning document is not updated, so if the image size changes, the document will still display the image at the old size, until the document itself is resaved.
Proposal
The only way for content documents to be successfully updated, would be to store a reverse lookup of which images are in which documents:
When documents are parsed:
When images are changed:
When assets are deleted or moved:
The thing to remember about moves is that they are reported by chokidar as a
delete
then anupdate
, so does this change how paths should be rewritten, or is this only a concern for the user?Also, it's possible that document moves would need to trigger this as well (should check if moves trigger the parsing hook).
Also, note that this only needs to happen if image size hints are on.
Otherwise, the image size should update automatically.
Notes
Consider if this would create problems if the related documents are open but not saved.
The target documents would need to be reloaded. Check live-reload section of #18 to see how this might be done.
The text was updated successfully, but these errors were encountered: